Editor: Add custom fields meta box support in the block editor.
This brings support for the custom fields meta box into the new block editor. The `webpack` and `copy-webpack-plugin` packages have also been updated. This does not bump the `@wordpress` packages like in [43861] because of conflicts with package versions already installed in `trunk`. The packages will be brought up to date in a subsequent merge. Merges [43861] and [43863] into trunk. See #45145. Fixes #45257. Built from https://develop.svn.wordpress.org/trunk@44260 git-svn-id: http://core.svn.wordpress.org/trunk@44090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -202,6 +202,29 @@ if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Image sizes.
|
||||
$image_sizes = get_intermediate_image_sizes();
|
||||
$image_sizes[] = 'full';
|
||||
|
||||
/** This filter is documented in wp-admin/includes/media.php */
|
||||
$image_size_names = apply_filters(
|
||||
'image_size_names_choose',
|
||||
array(
|
||||
'thumbnail' => __( 'Thumbnail' ),
|
||||
'medium' => __( 'Medium' ),
|
||||
'large' => __( 'Large' ),
|
||||
'full' => __( 'Full Size' ),
|
||||
)
|
||||
);
|
||||
|
||||
$available_image_sizes = array();
|
||||
foreach ( $image_sizes as $image_size_slug ) {
|
||||
$available_image_sizes[] = array(
|
||||
'slug' => $image_size_slug,
|
||||
'name' => isset( $image_size_names[ $image_size_slug ] ) ? $image_size_names[ $image_size_slug ] : $image_size_slug,
|
||||
);
|
||||
}
|
||||
|
||||
// Lock settings.
|
||||
$user_id = wp_check_post_lock( $post->ID );
|
||||
if ( $user_id ) {
|
||||
@@ -257,12 +280,17 @@ $editor_settings = array(
|
||||
'maxUploadFileSize' => $max_upload_size,
|
||||
'allowedMimeTypes' => get_allowed_mime_types(),
|
||||
'styles' => $styles,
|
||||
'availableImageSizes' => $available_image_sizes,
|
||||
'postLock' => $lock_details,
|
||||
'postLockUtils' => array(
|
||||
'nonce' => wp_create_nonce( 'lock-post_' . $post->ID ),
|
||||
'unlockNonce' => wp_create_nonce( 'update-post_' . $post->ID ),
|
||||
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
|
||||
),
|
||||
|
||||
// Whether or not to load the 'postcustom' meta box is stored as a user meta
|
||||
// field so that we're not always loading its assets.
|
||||
'enableCustomFields' => (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
|
||||
);
|
||||
|
||||
$autosave = wp_get_post_autosave( $post_ID );
|
||||
|
||||
Reference in New Issue
Block a user