_filter_block_template_part_area example


function _add_block_template_part_area_info( $template_info ) {
    if ( wp_theme_has_theme_json() ) {
        $theme_data = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_template_parts();
    }

    if ( isset( $theme_data[ $template_info['slug'] ]['area'] ) ) {
        $template_info['title'] = $theme_data[ $template_info['slug'] ]['title'];
        $template_info['area']  = _filter_block_template_part_area( $theme_data[ $template_info['slug'] ]['area'] );
    } else {
        $template_info['area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
    }

    return $template_info;
}

/** * Returns an array containing the references of * the passed blocks and their inner blocks. * * @since 5.9.0 * @access private * * @param array $blocks array of blocks. * @return array block references to the passed blocks and their inner blocks. */
if ( 'wp_template' === $this->post_type && isset( $request['is_wp_suggestion'] ) ) {
            $changes->meta_input     = wp_parse_args(
                array(
                    'is_wp_suggestion' => $request['is_wp_suggestion'],
                ),
                $changes->meta_input = array()
            );
        }

        if ( 'wp_template_part' === $this->post_type ) {
            if ( isset( $request['area'] ) ) {
                $changes->tax_input['wp_template_part_area'] = _filter_block_template_part_area( $request['area'] );
            } elseif ( null !== $template && 'custom' !== $template->source && $template->area ) {
                $changes->tax_input['wp_template_part_area'] = _filter_block_template_part_area( $template->area );
            } elseif ( empty( $template->area ) ) {
                $changes->tax_input['wp_template_part_area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
            }
        }

        if ( ! empty( $request['author'] ) ) {
            $post_author = (int) $request['author'];

            if ( get_current_user_id() !== $post_author ) {
                
Home | Imprint | This part of the site doesn't use cookies.