WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/12/2021 01:33:21 PM (9 months ago)
Author:
gziolo
Message:

Editor: Make block type aware of variations

Currently block variations are only defined on the client. In some cases, creating block variations on the server can be very useful, especially when needed data is not exposed in the REST APIs.

Related to https://github.com/WordPress/gutenberg/pull/29095.

Props: gwwar, timothyblynjacobs.
Fixes: #52688.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r50505 r50527  
    17041704 *                    'Page scheduled.'
    17051705 * - `item_updated` - Label used when an item is updated. Default is 'Post updated.' / 'Page updated.'
     1706 * - `item_link` - Title for a navigation link block variation. Default is 'Post Link' / 'Page Link'.
     1707 * - `item_link_description` - Description for a navigation link block variation. Default is 'A link to a post.' /
     1708 *                             'A link to a page.'
    17061709 *
    17071710 * Above, the first default value is for non-hierarchical post types (like posts)
     
    17271730 */
    17281731function get_post_type_labels( $post_type_object ) {
    1729     $nohier_vs_hier_defaults              = array(
     1732    $nohier_vs_hier_defaults                  = array(
    17301733        'name'                     => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ),
    17311734        'singular_name'            => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ),
     
    17581761        'item_scheduled'           => array( __( 'Post scheduled.' ), __( 'Page scheduled.' ) ),
    17591762        'item_updated'             => array( __( 'Post updated.' ), __( 'Page updated.' ) ),
     1763        'item_link'                => array(
     1764            _x( 'Post Link', 'navigation link block title' ),
     1765            _x( 'Page Link', 'navigation link block title' ),
     1766        ),
     1767        'item_link_description'    => array(
     1768            _x( 'A link to a post.', 'navigation link block description' ),
     1769            _x( 'A link to a page.', 'navigation link block description' ),
     1770        ),
    17601771    );
    17611772    $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
Note: See TracChangeset for help on using the changeset viewer.