GRAYBYTE WORDPRESS FILE MANAGER7839

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/chahida.co.in/wp-includes/rest-api/endpoints/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/chahida.co.in/wp-includes/rest-api/endpoints//class-wp-rest-blocks-controller.php
<?php
/**
 * Synced patterns REST API: WP_REST_Blocks_Controller class
 *
 * @package WordPress
 * @subpackage REST_API
 * @since 5.0.0
 */

/**
 * Controller which provides a REST endpoint for the editor to read, create,
 * edit, and delete synced patterns (formerly called reusable blocks).
 * Patterns are stored as posts with the wp_block post type.
 *
 * @since 5.0.0
 *
 * @see WP_REST_Posts_Controller
 * @see WP_REST_Controller
 */
class WP_REST_Blocks_Controller extends WP_REST_Posts_Controller {

	/**
	 * Checks if a pattern can be read.
	 *
	 * @since 5.0.0
	 *
	 * @param WP_Post $post Post object that backs the block.
	 * @return bool Whether the pattern can be read.
	 */
	public function check_read_permission( $post ) {
		// By default the read_post capability is mapped to edit_posts.
		if ( ! current_user_can( 'read_post', $post->ID ) ) {
			return false;
		}

		return parent::check_read_permission( $post );
	}

	/**
	 * Filters a response based on the context defined in the schema.
	 *
	 * @since 5.0.0
	 * @since 6.3.0 Adds the `wp_pattern_sync_status` postmeta property to the top level of response.
	 *
	 * @param array  $data    Response data to filter.
	 * @param string $context Context defined in the schema.
	 * @return array Filtered response.
	 */
	public function filter_response_by_context( $data, $context ) {
		$data = parent::filter_response_by_context( $data, $context );

		/*
		 * Remove `title.rendered` and `content.rendered` from the response.
		 * It doesn't make sense for a pattern to have rendered content on its own,
		 * since rendering a block requires it to be inside a post or a page.
		 */
		unset( $data['title']['rendered'] );
		unset( $data['content']['rendered'] );

		// Add the core wp_pattern_sync_status meta as top level property to the response.
		$data['wp_pattern_sync_status'] = isset( $data['meta']['wp_pattern_sync_status'] ) ? $data['meta']['wp_pattern_sync_status'] : '';
		unset( $data['meta']['wp_pattern_sync_status'] );
		return $data;
	}

	/**
	 * Retrieves the pattern's schema, conforming to JSON Schema.
	 *
	 * @since 5.0.0
	 *
	 * @return array Item schema data.
	 */
	public function get_item_schema() {
		if ( $this->schema ) {
			return $this->add_additional_fields_schema( $this->schema );
		}

		$schema = parent::get_item_schema();

		/*
		 * Allow all contexts to access `title.raw` and `content.raw`.
		 * Clients always need the raw markup of a pattern to do anything useful,
		 * e.g. parse it or display it in an editor.
		 */
		$schema['properties']['title']['properties']['raw']['context']   = array( 'view', 'edit' );
		$schema['properties']['content']['properties']['raw']['context'] = array( 'view', 'edit' );

		/*
		 * Remove `title.rendered` and `content.rendered` from the schema.
		 * It doesn't make sense for a pattern to have rendered content on its own,
		 * since rendering a block requires it to be inside a post or a page.
		 */
		unset( $schema['properties']['title']['properties']['rendered'] );
		unset( $schema['properties']['content']['properties']['rendered'] );

		$this->schema = $schema;

		return $this->add_additional_fields_schema( $this->schema );
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:19
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:19
giriqfky / giriqfky
0644
class-wp-rest-application-passwords-controller.php
23.588 KB
August 11 2022 22:24:10
giriqfky / giriqfky
0644
class-wp-rest-attachments-controller.php
47.862 KB
April 30 2025 17:38:13
giriqfky / giriqfky
0644
class-wp-rest-autosaves-controller.php
14.881 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-block-directory-controller.php
9.713 KB
December 10 2024 03:45:20
giriqfky / giriqfky
0644
class-wp-rest-block-pattern-categories-controller.php
4.701 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-block-patterns-controller.php
9.078 KB
June 13 2024 19:06:08
giriqfky / giriqfky
0644
class-wp-rest-block-renderer-controller.php
5.697 KB
June 30 2021 16:34:56
giriqfky / giriqfky
0644
class-wp-rest-block-types-controller.php
26.247 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-blocks-controller.php
3.104 KB
October 31 2023 18:23:22
giriqfky / giriqfky
0644
class-wp-rest-comments-controller.php
56.992 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-controller.php
18.621 KB
September 12 2023 19:23:18
giriqfky / giriqfky
0644
class-wp-rest-edit-site-export-controller.php
2.061 KB
March 04 2025 11:07:22
giriqfky / giriqfky
0644
class-wp-rest-font-collections-controller.php
10.402 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-font-faces-controller.php
29.113 KB
June 06 2024 03:19:18
giriqfky / giriqfky
0644
class-wp-rest-font-families-controller.php
17.104 KB
June 04 2024 15:55:14
giriqfky / giriqfky
0644
class-wp-rest-global-styles-controller.php
20.702 KB
September 18 2024 09:19:14
giriqfky / giriqfky
0644
class-wp-rest-global-styles-revisions-controller.php
12.381 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-menu-items-controller.php
32.489 KB
January 30 2025 04:15:24
giriqfky / giriqfky
0644
class-wp-rest-menu-locations-controller.php
8.753 KB
January 28 2025 09:09:22
giriqfky / giriqfky
0644
class-wp-rest-menus-controller.php
16.677 KB
January 28 2025 09:09:22
giriqfky / giriqfky
0644
class-wp-rest-navigation-fallback-controller.php
5.05 KB
October 16 2023 19:17:24
giriqfky / giriqfky
0644
class-wp-rest-pattern-directory-controller.php
12.638 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-plugins-controller.php
27.86 KB
September 18 2024 01:33:14
giriqfky / giriqfky
0644
class-wp-rest-post-statuses-controller.php
10.067 KB
July 09 2024 17:53:16
giriqfky / giriqfky
0644
class-wp-rest-post-types-controller.php
13.948 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-posts-controller.php
99.668 KB
April 30 2025 17:38:13
giriqfky / giriqfky
0644
class-wp-rest-revisions-controller.php
25.935 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-search-controller.php
11.212 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-settings-controller.php
10.114 KB
May 29 2024 12:53:10
giriqfky / giriqfky
0644
class-wp-rest-sidebars-controller.php
15.82 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-site-health-controller.php
9.605 KB
September 12 2023 19:23:18
giriqfky / giriqfky
0644
class-wp-rest-taxonomies-controller.php
13.687 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-template-autosaves-controller.php
7.642 KB
March 03 2025 03:07:26
giriqfky / giriqfky
0644
class-wp-rest-template-revisions-controller.php
8.52 KB
March 03 2025 03:07:26
giriqfky / giriqfky
0644
class-wp-rest-templates-controller.php
37.405 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-terms-controller.php
34.498 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-themes-controller.php
22.455 KB
March 11 2025 10:15:24
giriqfky / giriqfky
0644
class-wp-rest-url-details-controller.php
20.071 KB
July 11 2024 10:24:18
giriqfky / giriqfky
0644
class-wp-rest-users-controller.php
48.409 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-widget-types-controller.php
18.782 KB
March 11 2025 18:19:20
giriqfky / giriqfky
0644
class-wp-rest-widgets-controller.php
26.263 KB
March 19 2025 00:39:24
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF