Changeset 44260
- Timestamp:
- 12/17/2018 03:51:08 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43861,43863
- Property svn:mergeinfo changed
-
trunk/package-lock.json
r44233 r44260 3563 3563 }, 3564 3564 "copy-webpack-plugin": { 3565 "version": "4. 5.2",3566 "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4. 5.2.tgz",3567 "integrity": "sha512- zmC33E8FFSq3AbflTvqvPvBo621H36Afsxlui91d+QyZxPIuXghfnTsa1CuqiAaCPgJoSUWfTFbKJnadZpKEbQ==",3565 "version": "4.6.0", 3566 "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.6.0.tgz", 3567 "integrity": "sha512-Y+SQCF+0NoWQryez2zXn5J5knmr9z/9qSQt7fbL78u83rxmigOy8X5+BFn8CFSuX+nKT8gpYwJX68ekqtQt6ZA==", 3568 3568 "dev": true, 3569 3569 "requires": { -
trunk/package.json
r44233 r44260 18 18 "autoprefixer": "^9.1.5", 19 19 "check-node-version": "3.2.0", 20 "copy-webpack-plugin": "^4. 5.2",20 "copy-webpack-plugin": "^4.6.0", 21 21 "cssnano": "^4.1.4", 22 22 "grunt": "~1.0.3", … … 50 50 "uglify-js": "^3.4.9", 51 51 "uglifyjs-webpack-plugin": "^2.0.1", 52 "webpack": "^4.2 0.2",52 "webpack": "^4.24.0", 53 53 "webpack-dev-server": "^3.1.9", 54 54 "webpack-livereload-plugin": "^2.1.1" -
trunk/src/wp-admin/edit-form-blocks.php
r44251 r44260 203 203 } 204 204 205 // Image sizes. 206 $image_sizes = get_intermediate_image_sizes(); 207 $image_sizes[] = 'full'; 208 209 /** This filter is documented in wp-admin/includes/media.php */ 210 $image_size_names = apply_filters( 211 'image_size_names_choose', 212 array( 213 'thumbnail' => __( 'Thumbnail' ), 214 'medium' => __( 'Medium' ), 215 'large' => __( 'Large' ), 216 'full' => __( 'Full Size' ), 217 ) 218 ); 219 220 $available_image_sizes = array(); 221 foreach ( $image_sizes as $image_size_slug ) { 222 $available_image_sizes[] = array( 223 'slug' => $image_size_slug, 224 'name' => isset( $image_size_names[ $image_size_slug ] ) ? $image_size_names[ $image_size_slug ] : $image_size_slug, 225 ); 226 } 227 205 228 // Lock settings. 206 229 $user_id = wp_check_post_lock( $post->ID ); … … 258 281 'allowedMimeTypes' => get_allowed_mime_types(), 259 282 'styles' => $styles, 283 'availableImageSizes' => $available_image_sizes, 260 284 'postLock' => $lock_details, 261 285 'postLockUtils' => array( … … 264 288 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 265 289 ), 290 291 // Whether or not to load the 'postcustom' meta box is stored as a user meta 292 // field so that we're not always loading its assets. 293 'enableCustomFields' => (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ), 266 294 ); 267 295 -
trunk/src/wp-admin/includes/meta-boxes.php
r44244 r44260 1464 1464 1465 1465 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 } 1471 1481 } 1472 1482 -
trunk/src/wp-admin/includes/post.php
r44243 r44260 2113 2113 'slug' => 'common', 2114 2114 'title' => __( 'Common Blocks' ), 2115 'icon' => 'screenoptions',2115 'icon' => null, 2116 2116 ), 2117 2117 array( … … 2215 2215 <?php the_block_editor_meta_box_post_form_hidden_fields( $post ); ?> 2216 2216 </form> 2217 <form id="toggle-custom-fields-form" method="post" action="<?php echo esc_attr( admin_url( 'post.php' ) ); ?>"> 2218 <?php wp_nonce_field( 'toggle-custom-fields' ); ?> 2219 <input type="hidden" name="action" value="toggle-custom-fields" /> 2220 </form> 2217 2221 <?php foreach ( $locations as $location ) : ?> 2218 2222 <form class="metabox-location-<?php echo esc_attr( $location ); ?>" onsubmit="return false;"> … … 2290 2294 } 2291 2295 2296 /** 2297 * If the 'postcustom' meta box is enabled, then we need to perform some 2298 * extra initialization on it. 2299 */ 2300 $enable_custom_fields = (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ); 2301 if ( $enable_custom_fields ) { 2302 $script = "( function( $ ) { 2303 if ( $('#postcustom').length ) { 2304 $( '#the-list' ).wpList( { 2305 addBefore: function( s ) { 2306 s.data += '&post_id=$post->ID'; 2307 return s; 2308 }, 2309 addAfter: function() { 2310 $('table#list-table').show(); 2311 } 2312 }); 2313 } 2314 } )( jQuery );"; 2315 wp_enqueue_script( 'wp-lists' ); 2316 wp_add_inline_script( 'wp-lists', $script ); 2317 } 2318 2292 2319 // Reset meta box data. 2293 2320 $wp_meta_boxes = $_original_meta_boxes; -
trunk/src/wp-admin/post.php
r44165 r44260 313 313 exit(); 314 314 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 315 327 default: 316 328 /** -
trunk/src/wp-includes/script-loader.php
r44252 r44260 236 236 'lodash', 237 237 'wp-compose', 238 'wp-deprecated', 238 239 'wp-element', 239 240 'wp-is-shallow-equal', … … 352 353 'wp-blocks', 353 354 'wp-data', 355 'wp-deprecated', 354 356 'wp-escape-html', 355 357 'wp-polyfill',
Note: See TracChangeset
for help on using the changeset viewer.