PluginProbe
Gutenberg / 5.2.0
Gutenberg v5.2.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / lib / register.php

register.php in Gutenberg 5.2.0, at lib/register.php

87 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Initialization and wp-admin integration for the Gutenberg editor plugin.
4 *
5 * @package gutenberg
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 die( 'Silence is golden.' );
10 }
11
12 /**
13 * Return whether the post can be edited in Gutenberg and by the current user.
14 *
15 * @since 0.5.0
16 * @deprecated 5.1.0 use_block_editor_for_post
17 *
18 * @param int|WP_Post $post Post ID or WP_Post object.
19 * @return bool Whether the post can be edited with Gutenberg.
20 */
21 function gutenberg_can_edit_post( $post ) {
22 _deprecated_function( __FUNCTION__, '5.1.0', 'use_block_editor_for_post' );
23
24 require_once ABSPATH . 'wp-admin/includes/post.php';
25 return use_block_editor_for_post( $post );
26 }
27
28 /**
29 * Return whether the post type can be edited in Gutenberg.
30 *
31 * Gutenberg depends on the REST API, and if the post type is not shown in the
32 * REST API, then the post cannot be edited in Gutenberg.
33 *
34 * @since 1.5.2
35 * @deprecated 5.1.0 use_block_editor_for_post_type
36 *
37 * @param string $post_type The post type.
38 * @return bool Whether the post type can be edited with Gutenberg.
39 */
40 function gutenberg_can_edit_post_type( $post_type ) {
41 _deprecated_function( __FUNCTION__, '5.1.0', 'use_block_editor_for_post_type' );
42
43 require_once ABSPATH . 'wp-admin/includes/post.php';
44 return use_block_editor_for_post_type( $post_type );
45 }
46
47 /**
48 * Injects a hidden input in the edit form to propagate the information that classic editor is selected.
49 *
50 * @since 1.5.2
51 * @deprecated 5.1.0
52 */
53 function gutenberg_remember_classic_editor_when_saving_posts() {
54 _deprecated_function( __FUNCTION__, '5.1.0' );
55 }
56
57 /**
58 * Appends a query argument to the redirect url to make sure it gets redirected to the classic editor.
59 *
60 * @since 1.5.2
61 * @deprecated 5.1.0
62 *
63 * @param string $url Redirect url.
64 * @return string Redirect url.
65 */
66 function gutenberg_redirect_to_classic_editor_when_saving_posts( $url ) {
67 _deprecated_function( __FUNCTION__, '5.1.0' );
68
69 return $url;
70 }
71
72 /**
73 * Appends a query argument to the edit url to make sure it is redirected to
74 * the editor from which the user navigated.
75 *
76 * @since 1.5.2
77 * @deprecated 5.1.0
78 *
79 * @param string $url Edit url.
80 * @return string Edit url.
81 */
82 function gutenberg_revisions_link_to_editor( $url ) {
83 _deprecated_function( __FUNCTION__, '5.1.0' );
84
85 return $url;
86 }
87