/** * Get the widget's data. * * @return mixed */ public function get_data() { $data = parent::get_data(); $data['logo'] = Acf::get_option_field('contact_details_logo'); $data['address'] = Acf::get_option_field('contact_details_address'); $data['phone'] = Acf::get_option_field('contact_details_phone'); $data['email'] = Acf::get_option_field('contact_details_email'); return $data; }
/** * Get the widget's data. * * @return mixed */ public function get_data() { $data = parent::get_data(); $data['items'] = Acf::get_option_field('social_links'); return $data; }
/** * Get a fallback image for the post. * * @param \WP_Post $post The post. * @return mixed */ private static function get_fallback_image($post) { $image = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); if (empty($image)) { $logo = Acf::get_option_field(SiteIdentity::LOGO_KEY); $image = is_array($logo) ? $logo['src'] : get_site_icon_url(); } return $image; }
/** * Get the data. * * @Override * @param \WP_REST_Request $request The request. * * @return array|\WP_Error */ public function endpoint_callback(\WP_REST_Request $request) { $data = array_merge(['site_name' => get_bloginfo('name'), 'site_description' => get_bloginfo('description'), 'site_icon' => get_site_icon_url(), 'menus' => Menus::get_all_locations(), 'widgets' => Widgets::get_all_areas(), 'gravity_forms' => GravityForms::get_settings()], Acf::get_option_field()); return $this->filter_data($data); }