Plugin Directory

Changeset 2675847


Ignore:
Timestamp:
02/09/2022 05:05:54 PM (4 years ago)
Author:
mattwiebe
Message:

Update Editing Toolkit Plugin to 3.26678

Location:
full-site-editing/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • full-site-editing/trunk/full-site-editing-plugin.php

    r2675208 r2675847  
    33 * Plugin Name: WordPress.com Editing Toolkit
    44 * Description: Enhances your page creation workflow within the Block Editor.
    5  * Version: 3.26587
     5 * Version: 3.26678
    66 * Author: Automattic
    77 * Author URI: https://automattic.com/wordpress-plugins/
     
    4343 * @var string
    4444 */
    45 define( 'A8C_ETK_PLUGIN_VERSION', '3.26587' );
     45define( 'A8C_ETK_PLUGIN_VERSION', '3.26678' );
    4646
    4747// Always include these helper files for dotcom FSE.
  • full-site-editing/trunk/readme.txt

    r2675208 r2675847  
    44Requires at least: 5.5
    55Tested up to: 5.6
    6 Stable tag: 3.26587
     6Stable tag: 3.26678
    77Requires PHP: 5.6.20
    88License: GPLv2 or later
  • full-site-editing/trunk/wpcom-universal-themes/index.php

    r2675208 r2675847  
    101101    add_action( 'admin_bar_menu', 'gutenberg_adminbar_items', 50 );
    102102    add_action( 'admin_menu', __NAMESPACE__ . '\hide_nav_menus_submenu' );
    103 
    104     // Hides the AMP menu.
    105     remove_action( 'admin_menu', 'amp_add_customizer_link' );
    106 
    107103    remove_action( 'init', __NAMESPACE__ . '\hide_template_cpts', 11 );
    108104    remove_action( 'restapi_theme_init', __NAMESPACE__ . '\hide_template_cpts', 11 );
     
    123119    remove_action( 'admin_bar_menu', 'gutenberg_adminbar_items', 50 );
    124120    remove_action( 'admin_menu', __NAMESPACE__ . '\hide_nav_menus_submenu' );
    125 
    126     // Shows the AMP menu.
    127     add_action( 'admin_menu', 'amp_add_customizer_link' );
    128121
    129122    if ( defined( 'REST_API_REQUEST' ) && true === REST_API_REQUEST ) {
     
    151144    }
    152145
    153     // AMP registration on the default 10 priority is too early and confuses the current
    154     // Gutenberg (v12.5.1 at this comment's writing) `gutenberg_remove_legacy_pages` function
    155     // into mistaking it for the Customizer proper.
    156     if ( function_exists( 'amp_add_customizer_link' ) ) {
    157         remove_action( 'admin_menu', 'amp_add_customizer_link' );
    158         add_action( 'admin_menu', 'amp_add_customizer_link', 11 );
    159     }
     146    // Amp plugin helper.
     147    add_action( 'admin_menu', __NAMESPACE__ . '\maybe_juggle_amp_priority', 0 );
    160148
    161149    if ( apply_filters( 'a8c_hide_core_fse_activation', false ) ) {
     
    181169    remove_action( 'admin_menu', __NAMESPACE__ . '\add_submenu' );
    182170    remove_action( 'admin_init', __NAMESPACE__ . '\init_settings' );
     171    remove_action( 'admin_menu', __NAMESPACE__ . '\maybe_juggle_amp_priority', 0 );
     172}
     173
     174/**
     175 * AMP registration on the default 10 priority is too early and confuses the current Gutenberg
     176 * plugin's `gutenberg_remove_legacy_pages` function into mistaking it for the Customizer proper.
     177 *
     178 * This will be fixed once https://github.com/WordPress/gutenberg/pull/38598 is released.
     179 *
     180 * @return void
     181 */
     182function maybe_juggle_amp_priority() {
     183    if ( ! function_exists( 'amp_add_customizer_link' ) || ! has_action( 'admin_menu', 'amp_add_customizer_link' ) ) {
     184        return;
     185    }
     186
     187    remove_action( 'admin_menu', 'amp_add_customizer_link' );
     188    add_action( 'admin_menu', 'amp_add_customizer_link', 11 );
    183189}
    184190
Note: See TracChangeset for help on using the changeset viewer.