urn $pattern;
}
/**
* Prepare a raw block pattern before it gets output in a REST API response.
*
* @since 6.0.0
* @since 6.3.0 Added `source` property.
*
* @param array $item Raw pattern as registered, before any changes.
* @param WP_REST_Request $request Request object.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function prepare_item_for_response( $item, $request ) {
$fields = $this->get_fields_for_response( $request );
$keys = array(
'name' => 'name',
'title' => 'title',
'content' => 'content',
'description' => 'description',
'viewportWidth' => 'viewport_width',
'inserter' => 'inserter',
'categories' => 'categories',
'keywords' => 'keywords',
'blockTypes' => 'block_types',
'postTypes' => 'post_types',
'templateTypes' => 'template_types',
'source' => 'source',
);
$data = array();
foreach ( $keys as $item_key => $rest_key ) {
if ( isset( $item[ $item_key ] ) && rest_is_field_included( $rest_key, $fields ) ) {
$data[ $rest_key ] = $item[ $item_key ];
}
}
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
$data = $this->add_additional_fields_to_object( $data, $request );
$data = $this->filter_response_by_context( $data, $context );
return rest_ensure_response( $data );
}
/**
* Retrieves the block pattern schema, conforming to JSON Schema.
*
* @since 6.0.0
* @since 6.3.0 Added `source` property.
*
* @return array Item schema data.
*/
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'block-pattern',
'type' => 'object',
'properties' => array(
'name' => array(
'description' => __( 'The pattern name.' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'title' => array(
'description' => __( 'The pattern title, in human readable format.' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'content' => array(
'description' => __( 'The pattern content.' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'description' => array(
'description' => __( 'The pattern detailed description.' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'viewport_width' => array(
'description' => __( 'The pattern viewport width for inserter preview.' ),
'type' => 'number',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'inserter' => array(
'description' => __( 'Determines whether the pattern is visible in inserter.' ),
'type' => 'boolean',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'categories' => array(
'description' => __( 'The pattern category slugs.' ),
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'keywords' => array(
'description' => __( 'The pattern keywords.' ),
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'block_types' => array(
'description' => __( 'Block types that the pattern is intended to be used with.' ),
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'post_types' => array(
'description' => __( 'An array of post types that the pattern is restricted to be used with.' ),
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'template_types' => array(
'description' => __( 'An array of template types where the pattern fits.' ),
'type' => 'array',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
),
'source' => array(
'description' => __( 'Where the pattern comes from e.g. core' ),
'type' => 'string',
'readonly' => true,
'context' => array( 'view', 'edit', 'embed' ),
'enum' => array(
'core',
'plugin',
'theme',
'pattern-directory/core',
'pattern-directory/theme',
'pattern-directory/featured',
),
),
),
);
$this->schema = $schema;
return $this->add_additional_fields_schema( $this->schema );
}
}
Warning: include(): Failed opening '/home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/vendor/composer/../../app/Common/Sitemap/RequestParser.php' for inclusion (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/vendor/composer/ClassLoader.php on line 576
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\Sitemap\RequestParser" not found in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Sitemap/RequestParser.php:16
Stack trace:
#0 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/vendor/composer/ClassLoader.php(576): include()
#1 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/home/valigeria...')
#2 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Sitemap/Sitemap.php(36): Composer\Autoload\ClassLoader->loadClass('AIOSEO\\Plugin\\P...')
#3 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(311): AIOSEO\Plugin\Pro\Sitemap\Sitemap->__construct()
#4 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load()
#5 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init()
#6 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance()
#7 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/all_in_one_seo_pack.php(96): aioseo()
#8 /home/valigeria/public_html/wp-settings.php(517): include_once('/home/valigeria...')
#9 /home/valigeria/public_html/wp-config.php(111): require_once('/home/valigeria...')
#10 /home/valigeria/public_html/wp-load.php(50): require_once('/home/valigeria...')
#11 /home/valigeria/public_html/wp-blog-header.php(13): require_once('/home/valigeria...')
#12 /home/valigeria/public_html/index.php(17): require('/home/valigeria...')
#13 {main}
thrown in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Sitemap/RequestParser.php on line 16