Make WordPress Core


Ignore:
Timestamp:
06/26/2020 01:31:11 PM (5 years ago)
Author:
ellatrix
Message:

Editor: update JavaScript packages

Also update default block categories

Props youknowriad, gziolo, aduth.
Fixes #50420, #50278.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/social-link.php

    r47495 r48177  
    1414 */
    1515function render_block_core_social_link( $attributes ) {
    16     $service = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon';
    17     $url     = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
    18     $label   = ( isset( $attributes['label'] ) ) ?
    19         $attributes['label'] :
    20         /* translators: %s: Social Link service name */
    21         sprintf( __( 'Link to %s' ), block_core_social_link_get_name( $service ) );
     16    $service    = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon';
     17    $url        = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
     18    $label      = ( isset( $attributes['label'] ) ) ? $attributes['label'] : block_core_social_link_get_name( $service );
    2219    $class_name = isset( $attributes['className'] ) ? ' ' . $attributes['className'] : false;
    2320
     
    3532 */
    3633function register_block_core_social_link() {
    37     $path     = __DIR__ . '/social-link/block.json';
    38     $metadata = json_decode( file_get_contents( $path ), true );
    39 
    40     register_block_type(
    41         $metadata['name'],
    42         array_merge(
    43             $metadata,
    44             array(
    45                 'render_callback' => 'render_block_core_social_link',
    46             )
     34    register_block_type_from_metadata(
     35        __DIR__ . '/social-link',
     36        array(
     37            'render_callback' => 'render_block_core_social_link',
    4738        )
    4839    );
     
    219210        'tumblr'        => array(
    220211            'name' => 'Tumblr',
    221             'icon' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" focusable="false"><path d="M16.749,17.396c-0.357,0.17-1.041,0.319-1.551,0.332c-1.539,0.041-1.837-1.081-1.85-1.896V9.847h3.861V6.937h-3.847V2.039 c0,0-2.77,0-2.817,0c-0.046,0-0.127,0.041-0.138,0.144c-0.165,1.499-0.867,4.13-3.783,5.181v2.484h1.945v6.282 c0,2.151,1.587,5.206,5.775,5.135c1.413-0.024,2.982-0.616,3.329-1.126L16.749,17.396z"></path></svg>',
     212            'icon' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" focusable="false"><path d="M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z" /></path></svg>',
    222213        ),
    223214        'twitch'        => array(
     
    251242        'share'         => array(
    252243            'name' => 'Share Icon',
    253             'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" role="img" aria-hidden="true" focusable="false"><rect x="0" fill="none" width="20" height="20"/><g><path d="M14.5 12c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.24.03-.46.09-.69l-4.38-2.3c-.55.61-1.33.99-2.21.99-1.66 0-3-1.34-3-3s1.34-3 3-3c.88 0 1.66.39 2.21.99l4.38-2.3c-.06-.23-.09-.45-.09-.69 0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-.88 0-1.66-.39-2.21-.99l-4.38 2.3c.06.23.09.45.09.69s-.03.46-.09.69l4.38 2.3c.55-.61 1.33-.99 2.21-.99z"/></g></svg>',
     244            'icon' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"/></svg>',
    254245        ),
    255246    );
Note: See TracChangeset for help on using the changeset viewer.