mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 10:22:23 +01:00
Blocks: Add "Export as JSON" action to the wp_block
post list screen.
Remove the "Quick Edit" for `wp_block`s, too, as they don't need any of that functionality. Props noisysocks. Fixes #45247. Built from https://develop.svn.wordpress.org/branches/5.0@43854 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a3b620f104
commit
eb4031a209
@ -1237,12 +1237,15 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ),
|
||||
__( 'Edit' )
|
||||
);
|
||||
$actions['inline hide-if-no-js'] = sprintf(
|
||||
'<a href="#" class="editinline" aria-label="%s">%s</a>',
|
||||
/* translators: %s: post title */
|
||||
esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $title ) ),
|
||||
__( 'Quick Edit' )
|
||||
);
|
||||
|
||||
if ( 'wp_block' !== $post->post_type ) {
|
||||
$actions['inline hide-if-no-js'] = sprintf(
|
||||
'<a href="#" class="editinline" aria-label="%s">%s</a>',
|
||||
/* translators: %s: post title */
|
||||
esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $title ) ),
|
||||
__( 'Quick Edit' )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( current_user_can( 'delete_post', $post->ID ) ) {
|
||||
@ -1297,6 +1300,16 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'wp_block' === $post->post_type ) {
|
||||
$actions['export'] = sprintf(
|
||||
'<button type="button" class="wp-list-reusable-blocks__export button-link" data-id="%s" aria-label="%s">%s</button>',
|
||||
$post->ID,
|
||||
/* translators: %s: post title */
|
||||
esc_attr( sprintf( __( 'Export “%s” as JSON' ), $title ) ),
|
||||
__( 'Export as JSON' )
|
||||
);
|
||||
}
|
||||
|
||||
if ( is_post_type_hierarchical( $post->post_type ) ) {
|
||||
|
||||
/**
|
||||
|
2
wp-includes/js/dist/blocks.js.map
vendored
2
wp-includes/js/dist/blocks.js.map
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-beta2-43853';
|
||||
$wp_version = '5.0-beta2-43854';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user