} if ( in_array( WP_REST_Search_Controller::PROP_URL, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_URL ] = get_permalink( $post->ID ); } if ( in_array( WP_REST_Search_Controller::PROP_TYPE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_TYPE ] = $this->type; } if ( in_array( WP_REST_Search_Controller::PROP_SUBTYPE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_SUBTYPE ] = $post->post_type; } return $data; } /** * Prepares links for the search result of a given ID. * * @since 5.0.0 * * @param int $id Item ID. * @return array Links for the given item. */ public function prepare_item_links( $id ) { $post = get_post( $id ); $links = array(); $item_route = rest_get_route_for_post( $post ); if ( ! empty( $item_route ) ) { $links['self'] = array( 'href' => rest_url( $item_route ), 'embeddable' => true, ); } $links['about'] = array( 'href' => rest_url( 'wp/v2/types/' . $post->post_type ), ); return $links; } /** * Overwrites the default protected and private title format. * * By default, WordPress will show password protected or private posts with a title of * "Protected: %s" or "Private: %s", as the REST API communicates the status of a post * in a machine-readable format, we remove the prefix. * * @since 5.0.0 * * @return string Title format. */ public function protected_title_format() { return '%s'; } /** * Attempts to detect the route to access a single item. * * @since 5.0.0 * @deprecated 5.5.0 Use rest_get_route_for_post() * @see rest_get_route_for_post() * * @param WP_Post $post Post object. * @return string REST route relative to the REST base URI, or empty string if unknown. */ protected function detect_rest_item_route( $post ) { _deprecated_function( __METHOD__, '5.5.0', 'rest_get_route_for_post()' ); return rest_get_route_for_post( $post ); } } > esc_html__( 'Normal 400', 'kirki' ), 'regular' => esc_html__( 'Normal 400', 'kirki' ), 'italic' => esc_html__( 'Normal 400 Italic', 'kirki' ), '500' => esc_html__( 'Medium 500', 'kirki' ), '500italic' => esc_html__( 'Medium 500 Italic', 'kirki' ), '600' => esc_html__( 'Semi-Bold 600', 'kirki' ), '600bold' => esc_html__( 'Semi-Bold 600', 'kirki' ), '600italic' => esc_html__( 'Semi-Bold 600 Italic', 'kirki' ), '700' => esc_html__( 'Bold 700', 'kirki' ), '700italic' => esc_html__( 'Bold 700 Italic', 'kirki' ), '800' => esc_html__( 'Extra-Bold 800', 'kirki' ), '800bold' => esc_html__( 'Extra-Bold 800', 'kirki' ), '800italic' => esc_html__( 'Extra-Bold 800 Italic', 'kirki' ), '900' => esc_html__( 'Ultra-Bold 900', 'kirki' ), '900bold' => esc_html__( 'Ultra-Bold 900', 'kirki' ), '900italic' => esc_html__( 'Ultra-Bold 900 Italic', 'kirki' ), ]; } /** * Determine if a font-name is a valid google font or not. * * @static * @access public * @param string $fontname The name of the font we want to check. * @return bool */ public static function is_google_font( $fontname ) { if ( is_string( $fontname ) ) { $fonts = self::get_google_fonts(); return isset( $fonts[ $fontname ] ); } return false; } /** * Gets available options for a font. * * @static * @access public * @return array */ public static function get_font_choices() { $fonts = self::get_all_fonts(); $keys = array_keys( $fonts ); return array_combine( $keys, $keys ); } } lf::$content_path = \wp_normalize_path( \untrailingslashit( WP_CONTENT_DIR ) ); } } }