New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add block data to REST API #2649

Closed
wants to merge 54 commits into
base: master
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+3 −2
Diff settings

Always

Just for now

Viewing a subset of changes. View all

restore register.php

  • Loading branch information...
adamsilverstein committed Sep 2, 2017
commit 632a07d9e92fbe193f4e099aa21c8a77131b964d
View
@@ -73,7 +73,6 @@ function gutenberg_add_edit_links_filters() {
add_filter( 'page_row_actions', 'gutenberg_add_edit_links', 10, 2 );
// For non-hierarchical post types.
add_filter( 'post_row_actions', 'gutenberg_add_edit_links', 10, 2 );
}
add_action( 'admin_init', 'gutenberg_add_edit_links_filters' );
@@ -83,6 +82,7 @@ function load_blocks_rest_api() {
}
add_action( 'init', 'load_blocks_rest_api' );
/**
* Registers additional links in the post/page screens to edit any post/page in
* the Gutenberg editor.
@@ -97,8 +97,9 @@ function load_blocks_rest_api() {
function gutenberg_add_edit_links( $actions, $post ) {
$can_edit_post = current_user_can( 'edit_post', $post->ID );
$title = _draft_or_post_title( $post->ID );
$post_type = get_post_type( $post );
if ( $can_edit_post && 'trash' !== $post->post_status ) {
if ( $can_edit_post && 'trash' !== $post->post_status && apply_filters( 'gutenberg_add_edit_link_for_post_type', true, $post_type, $post ) ) {
// Build the Gutenberg edit action. See also: WP_Posts_List_Table::handle_row_actions().
$gutenberg_url = menu_page_url( 'gutenberg', false );
$gutenberg_action = sprintf(
ProTip! Use n and p to navigate between commits in a pull request.