Make WordPress Core


Ignore:
Timestamp:
12/17/2018 03:51:08 AM (5 years ago)
Author:
desrosj
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/meta-boxes.php

    r44244 r44260  
    14641464
    14651465    if ( post_type_supports( $post_type, 'custom-fields' ) ) {
    1466         $args = array(
    1467             '__back_compat_meta_box'             => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
    1468             '__block_editor_compatible_meta_box' => true,
    1469         );
    1470         add_meta_box( 'postcustom', __( 'Custom Fields' ), 'post_custom_meta_box', null, 'normal', 'core', $args );
     1466        $screen = get_current_screen();
     1467        if ( ! $screen || ! $screen->is_block_editor() || (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ) ) {
     1468            add_meta_box(
     1469                'postcustom',
     1470                __( 'Custom Fields' ),
     1471                'post_custom_meta_box',
     1472                null,
     1473                'normal',
     1474                'core',
     1475                array(
     1476                    '__back_compat_meta_box'             => false,
     1477                    '__block_editor_compatible_meta_box' => true,
     1478                )
     1479            );
     1480        }
    14711481    }
    14721482
Note: See TracChangeset for help on using the changeset viewer.