mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 13:14:29 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@44260 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -312,6 +312,18 @@ switch ( $action ) {
|
||||
wp_redirect( $url );
|
||||
exit();
|
||||
|
||||
case 'toggle-custom-fields':
|
||||
check_admin_referer( 'toggle-custom-fields' );
|
||||
|
||||
$current_user_id = get_current_user_id();
|
||||
if ( $current_user_id ) {
|
||||
$enable_custom_fields = (bool) get_user_meta( $current_user_id, 'enable_custom_fields', true );
|
||||
update_user_meta( $current_user_id, 'enable_custom_fields', ! $enable_custom_fields );
|
||||
}
|
||||
|
||||
wp_safe_redirect( wp_get_referer() );
|
||||
exit();
|
||||
|
||||
default:
|
||||
/**
|
||||
* Fires for a given custom post action request.
|
||||
|
||||
Reference in New Issue
Block a user