Make WordPress Core


Ignore:
Timestamp:
12/17/2018 03:51:08 AM (6 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/post.php

    r44165 r44260  
    313313        exit();
    314314
     315    case 'toggle-custom-fields':
     316        check_admin_referer( 'toggle-custom-fields' );
     317
     318        $current_user_id = get_current_user_id();
     319        if ( $current_user_id ) {
     320            $enable_custom_fields = (bool) get_user_meta( $current_user_id, 'enable_custom_fields', true );
     321            update_user_meta( $current_user_id, 'enable_custom_fields', ! $enable_custom_fields );
     322        }
     323
     324        wp_safe_redirect( wp_get_referer() );
     325        exit();
     326
    315327    default:
    316328        /**
Note: See TracChangeset for help on using the changeset viewer.