Skip to content
Snippets Groups Projects

Introduce native Gutenberg controls

Merged Erick Hitter requested to merge add/gutenberg-native-meta into master
Compare and Show latest version
1 file
+ 8
4
Compare changes
  • Side-by-side
  • Inline
@@ -292,7 +292,10 @@ class WP_Revisions_Control {
*/
public function action_add_meta_boxes( $post_type, $post ) {
if (
use_block_editor_for_post( $post )
(
function_exists( 'use_block_editor_for_post' )
&& use_block_editor_for_post( $post )
)
|| ! post_type_supports( $post_type, 'revisions' )
|| 'auto-draft' === get_post_status()
|| count( wp_get_post_revisions( $post ) ) < 1
@@ -555,7 +558,7 @@ class WP_Revisions_Control {
'wp-revisions-control/v1',
'schedule/(?P<id>[\d]+)',
array(
'methods' => 'PUT',
'methods' => 'PUT',
'callback' => array( $this, 'rest_api_schedule_purge' ),
'permission_callback' => array( $this, 'rest_api_permission_callback' ),
'args' => array(
@@ -565,6 +568,7 @@ class WP_Revisions_Control {
'validate_callback' => array( $this, 'rest_api_validate_id' ),
),
),
'show_in_index' => false,
)
);
}
@@ -602,9 +606,9 @@ class WP_Revisions_Control {
$result = wp_schedule_single_event(
time() + 3,
$this->cron_action,
[
array(
$request->get_param( 'id' ),
]
)
);
return rest_ensure_response( $result );
Loading