context['postId'] ) || ! isset( $attributes['term'] ) ) { return ''; } if ( ! is_taxonomy_viewable( $attributes['term'] ) ) { return ''; } $classes = array( 'taxonomy-' . $attributes['term'] ); if ( isset( $attributes['textAlign'] ) ) { $classes[] = 'has-text-align-' . $attributes['textAlign']; } if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { $classes[] = 'has-link-color'; } $separator = empty( $attributes['separator'] ) ? ' ' : $attributes['separator']; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); $prefix = "
"; if ( isset( $attributes['prefix'] ) && $attributes['prefix'] ) { $prefix .= '' . $attributes['prefix'] . ''; } $suffix = '
'; if ( isset( $attribut 'GET', 'callback' => array( $this, 'get_surveys' ), 'permission_callback' => array( $this, 'create_edit_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys/(?P\w+)', array( 'methods' => 'GET', 'callback' => array( $this, 'get_survey' ), 'permission_callback' => array( $this, 'create_edit_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys', array( 'methods' => 'POST', 'callback' => array( $this, 'save_survey' ), 'permission_callback' => array( $this, 'create_edit_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys/restore', array( 'methods' => 'POST', 'callback' => array( $this, 'restore_surveys' ), 'permission_callback' => array( $this, 'delete_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys/draft', array( 'methods' => 'POST', 'callback' => array( $this, 'draft_surveys' ), 'permission_callback' => array( $this, 'create_edit_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys/trash', array( 'methods' => 'POST', 'callback' => array( $this, 'trash_surveys' ), 'permission_callback' => array( $this, 'delete_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys/publish', array( 'methods' => 'POST', 'callback' => array( $this, 'publish_surveys' ), 'permission_callback' => array( $this, 'create_edit_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys', array( 'methods' => 'DELETE', 'callback' => array( $this, 'delete_surveys' ), 'permission_callback' => array( $this, 'delete_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/surveys/(?P\w+)/duplicate', array( 'methods' => 'POST', 'callback' => array( $this, 'duplicate_survey' ), 'permission_callback' => array( $this, 'create_edit_surveys_permission_check' ), ) ); register_rest_route( 'userfeedback/v1', '/survey-templates', array( 'methods' => 'GET', 'callback' => array( $this, 'get_available_survey_templates' ), 'permission_callback' => array( $this, 'create_edit_surveys_permission_check' ), ) ); } /** * Permissions Check * * @return bool */ public function create_edit_surveys_permission_check() { return current_user_can( 'userfeedback_create_edit_surveys' ); } /** * Permissions Check * * @return bool */ public function delete_surveys_permission_check() { return current_user_can( 'userfeedback_delete_surveys' ); } /** * Get Surveys * * @return WP_REST_Response */ public function get_surveys( WP_REST_Request $request ) { $has_pagination = false; $query = UserFeedback_Survey::where( array( array( 'status', '!=', 'trash' ), // Get only published and drafts by default ) )->with_count( array( 'responses' ) ); if ( $request->has_param( 'filter' ) ) { $filters = $request->get_param( 'filter' ); foreach ( $filters as $attr => $value ) { if ( $value === 'all' ) { break; } if ( $attr === 'status' && $value === 'publish' ) { $query->add_where( array( 'status' => 'publish', 'publish_at' => null, ), true )->or_where( array( 'status' => 'publish', array( 'publish_at', '<=', current_time( 'mysql', true ) ), ) ); } elseif ( $attr === 'status' && $value === 'scheduled' ) { $query->add_where( array( 'status' => 'publish', array( 'publish_at', 'is not', null ), array( 'publish_at', '>', current_time( 'mysql', true ) ), ), true ); } else { $query->add_where( array( $attr => $value, ), true ); } } } if ( $request->has_param( 'orderby' ) ) { $field = $request->get_param( 'orderby' ); $order = $request->get_param( 'order' ); $order = $order ?: 'desc'; $query->sort( $field, $order ); } else { $query->sort( 'id', 'desc' ); } if ( $request->has_param( 'select' ) ) { $query->select( $request->get_param( 'select' ) ); } if ( $request->has_param( 'page' ) ) { $has_pagination = true; $query->paginate( $request->has_param( 'per_page' ) ? $request->get_param('per_page') : 10, $request->get_param( 'page' ) ); } $surveys = $query->get(); if ( ! $has_pagination ) { return new WP_REST_Response( $surveys ); } // Data for quick filters $count_by_status_result = UserFeedback_Survey::query() ->select( array( 'status', 'count' ) ) ->select_raw( 'if (publish_at is null or publish_at <= now(), false, true) as scheduled' ) ->group_by( 'status, scheduled' ) ->get(); $allTotal = 0; foreach ( $count_by_status_result as $item ) { if ( $item->status !== 'trash' ) { $allTotal += $item->count; } if ( $item->status === 'publish' && $item->scheduled ) { $item->status = 'scheduled'; } unset( $item->scheduled ); } array_unshift( $count_by_status_result, array( 'status' => 'all', 'count' => $allTotal, ) ); $surveys['status_filters'] = $count_by_status_result; return new WP_REST_Response( $surveys ); } /** * Get a single survey by id * * @return WP_REST_Response */ public function get_survey( WP_REST_Request $request ) { $survey_id = $request->get_param( 'id' ); $survey = UserFeedback_Survey::find( $survey_id ); if ( ! $survey ) { return new WP_REST_Response( null, 404 ); } if ( $request->has_param( 'with' ) ) { $query_instance = UserFeedback_Survey::query(); $query_instance->with( explode( ',', $request->get_param( 'with' ) ) ); $survey = $query_instance->populate_relations( $survey ); } return new WP_REST_Response( $survey ); } /** * Saves or updates a Survey * * @return WP_REST_Response */ public function save_survey( WP_REST_Request $request ) { // Check if params include id $survey_id = $request['id']; if ( userfeedback_is_tracking_allowed() && isset( $request['template'] ) ) { $tracked_data = get_option( 'userfeedback_tracking_data', array() ); if ( isset( $tracked_data['templates'] ) ) { $tracked_data['templates'][] = $request['template']; } else { $tracked_data['templates'] = array( $request['template'], ); } update_option( 'userfeedback_tracking_data', $tracked_data ); } $params = $request->get_params(); $survey_count = UserFeedback_Survey::count(); if(isset($params['title']) && 'First Survey' === $params['title'] && $survey_count > 0) { $survey = UserFeedback_Survey::get_by( 'title', 'First Survey' ); return new WP_REST_Response( $survey ); } if ( isset( $survey_id ) && $survey_id != 'null' ) { UserFeedback_Survey::update( $survey_id, $params ); $survey = UserFeedback_Survey::find( $survey_id ); } else { $number_of_surveys = UserFeedback_Survey::count(); $new_survey_title = empty( $params['title'] ) ? sprintf( __( 'Survey #%d', 'userfeedback' ), $number_of_surveys + 1 ) : $params['title']; $new_id = UserFeedback_Survey::create( array_merge( $params, array( 'title' => $new_survey_title ) ) ); $survey = UserFeedback_Survey::find( $new_id ); } return new WP_REST_Response( $survey ); } /** * Duplicate survey with the given id * * @return WP_REST_Response */ public function duplicate_survey( $data ) { $survey_id = $data['id']; $survey = UserFeedback_Survey::find( $survey_id ); // Save as new survey, return new one's id unset( $survey->id ); $new_survey_id = UserFeedback_Survey::create( array_merge( (array) $survey, array( 'title' => sprintf( __( 'Copy of %s', 'userfeedback' ), $survey->title ), 'status' => 'draft', ) ) ); $new_survey = UserFeedback_Survey::find( $new_survey_id ); return new WP_REST_Response( $new_survey ); } /** * Restore surveys by Id * * @return WP_REST_Response */ public function restore_surveys( $d 首頁 - IMDA 國際母嬰產業發展協會

專業照護,讓母嬰更健康

Professional Care for a Healthier Mother and Baby.

國際母嬰產業發展協會

第五屆國際金孕獎|熱烈報名中


第五屆國際金孕獎|熱烈報名中


年度母嬰產業最高榮譽,從專業服務到創新模式,讓你的品牌成為國際焦點。
The 5th IMDA Golden  Awards is now open for global entries.
Showcase your excellence in maternal & infant care on the international stage.

2026 成都國際母嬰產業研學團


2026 成都國際母嬰產業研學團-熱烈報名中


金孕獎 × 產業標竿參訪 × 城市文化深度體驗,專為母嬰產業決策者設計的 4 天 3 夜國際研學之旅。
A 4-day, 3-night IMDA study tour in Chengdu for leaders in the maternal & infant industry – 
combining the IMDA Golden Awards, benchmark site visits, and cultural immersion.

第五屆國際金孕獎|熱烈報名中


第五屆國際金孕獎|熱烈報名中


年度母嬰產業最高榮譽,從專業服務到創新模式,讓你的品牌成為國際焦點。
The 5th IMDA Golden  Awards is now open for global entries.
Showcase your excellence in maternal & infant care on the international stage.

About Us

關於我們

國際母嬰產業發展協會(IMDA)是全球性非營利組織,致力於推動母嬰產業的發展與創新。我們為母嬰產業打造一個全球平台,促進健康發展、提高母嬰健康水平,推廣優質產品和服務。我們核心價值觀包括專業、合作、可持續發展和多元文化。作為成員,您可享受產業人脈、知識資源、專業培訓、國際合作和市場推廣的福利。我們舉辦國際會議、研究報告、培訓課程、技術創新和社會公益活動等。誠邀企業家、投資者、研究人員和熱愛母嬰產業的個人加入,攜手為產業繁榮和全球家庭的幸福努力。

News

最新消息

hero_kv

FamiGuide 父母學堂開課嚕!

-DAYS-HOURS-MINUTES-SECONDS FamilyGuide 父母學堂 | 兩天,遇見更好的父母自己 2 天 12 小時實體課程|限量 40 對家庭幫助你修復原生家庭烙印,建立穩定家…

閱讀更多
新手父母

新手父母人生第一堂必修課

歡迎參加【國際母嬰協會主辦 – 新手父母人生第一堂必修課】,這是一堂專為孕期及 0-3 歲新手爸媽設計的入門課程,讓您與伴侶一同學習,打好孩子未來不可逆的成長基礎。 主講人|專業親職教育著名專家、作家…

閱讀更多
全國績優護理人員表揚活動圓滿成功

國際母嬰產業發展協會「電子報」

敬致最溫柔的守護者——全國績優護理人員表揚活動圓滿成功2025年5月7日 發行 親愛的協會會員您好: 在這溫暖的五月,國際母嬰產業發展協會,受邀出席於中國國民黨中央黨部舉行的「全國績優護理人員表揚大會…

閱讀更多
2023金孕獎精華版The 3rd  IMDA Golden Awards

Class

課程活動

新手父母

新手父母人生第一堂必修課

歡迎參加【國際母嬰協會主辦 – 新手父母人生第一堂必修課】,這是一堂專為孕期及 0-3 歲新手爸媽設計的入門課程,讓您與伴侶一同學習,打好孩子未來不可逆的成長基礎。 主講人|專業親職教育著名專家、作家…

Screenshot-from-2023-05-14-09-11-43

國際母嬰產業發展協會-大師講座系列分享

尊敬的國際母嬰產業發展協會會員們您好: 感謝奇思方舟林庭宇CEO,我們深入探討了「AI幫助企業的解決方案以及提升競爭力」這一關鍵議題,我們共同見證了科技帶來的革命性變革。就像花朵在春風中綻放,AI正為…

Brands

合作單位

國際母嬰產業發展協會

如果您有任何疑問、建議或需求,歡迎通過以下方式與我們聯絡。我們將竭誠為您提供協助。

周一至周五:上午10::00 – 下午6:00(國定假日除外)
02-8772-8050
mombaby688@gmail.com
106台北市大安區新生南路一段95號1樓

姓名
連絡電話
電子郵箱
訊息
The form has been submitted successfully!
There has been some error while submitting the form. Please verify all form fields again.