Make WordPress Core


Ignore:
Timestamp:
11/03/2018 07:56:28 AM (8 years ago)
Author:
pento
Message:

Build Tools: Update the @wordpress packages.

This brings support for the custom fields meta box to the block editor.

The webpack and copy-webpack-plugin packages have also been updated.

See #45145.
Fixes #45257.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/edit-form-blocks.php

    r43857 r43861  
    209209}
    210210
     211// Image sizes.
     212$image_sizes   = get_intermediate_image_sizes();
     213$image_sizes[] = 'full';
     214
     215/** This filter is documented in wp-admin/includes/media.php */
     216$image_size_names = apply_filters(
     217        'image_size_names_choose',
     218        array(
     219                'thumbnail' => __( 'Thumbnail' ),
     220                'medium'    => __( 'Medium' ),
     221                'large'     => __( 'Large' ),
     222                'full'      => __( 'Full Size' ),
     223        )
     224);
     225
     226$available_image_sizes = array();
     227foreach ( $image_sizes as $image_size_slug ) {
     228        $available_image_sizes[] = array(
     229                'slug' => $image_size_slug,
     230                'name' => isset( $image_size_names[ $image_size_slug ] ) ? $image_size_names[ $image_size_slug ] : $image_size_slug,
     231        );
     232}
     233
    211234// Lock settings.
    212235$user_id = wp_check_post_lock( $post->ID );
     
    264287        'allowedMimeTypes'       => get_allowed_mime_types(),
    265288        'styles'                 => $styles,
     289        'availableImageSizes'    => $available_image_sizes,
    266290        'postLock'               => $lock_details,
    267291        'postLockUtils'          => array(
     
    270294                'ajaxUrl'     => admin_url( 'admin-ajax.php' ),
    271295        ),
     296
     297        // Whether or not to load the 'postcustom' meta box is stored as a user meta
     298        // field so that we're not always loading its assets.
     299        'enableCustomFields'     => (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ),
    272300);
    273301
Note: See TracChangeset for help on using the changeset viewer.