Plugin Directory

Changeset 2868945


Ignore:
Timestamp:
02/21/2023 06:11:48 PM (3 years ago)
Author:
Copons
Message:

Update Editing Toolkit Plugin to 3.57000

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

Legend:

Unmodified
Added
Removed
  • full-site-editing/trunk/build_meta.txt

    r2868790 r2868945  
    1 commit_hash=d6273a1114cf166cc5b91cf85b4e26e13244a6d0
    2 commit_url=https://github.com/Automattic/wp-calypso/commit/d6273a1114cf166cc5b91cf85b4e26e13244a6d0
    3 build_number=3.56963
     1commit_hash=e40203ed2a04685a44bd0850e5381f95d056603f
     2commit_url=https://github.com/Automattic/wp-calypso/commit/e40203ed2a04685a44bd0850e5381f95d056603f
     3build_number=3.57000
  • full-site-editing/trunk/full-site-editing-plugin.php

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

    r2868790 r2868945  
    44Requires at least: 5.5
    55Tested up to: 6.0
    6 Stable tag: 3.56963
     6Stable tag: 3.57000
    77Requires PHP: 5.6.20
    88License: GPLv2 or later
  • full-site-editing/trunk/wpcom-global-styles/index.php

    r2868773 r2868945  
    144144 */
    145145function wpcom_global_styles_enqueue_assets() {
    146     if ( ! wpcom_should_limit_global_styles() ) {
     146    if (
     147        ! wpcom_global_styles_current_user_can_edit_wp_global_styles() ||
     148        ! wpcom_should_limit_global_styles() ||
     149        ! wpcom_global_styles_in_use()
     150    ) {
    147151        return;
    148152    }
     
    256260
    257261/**
     262 * Checks if the current user can edit the `wp_global_styles` post type.
     263 *
     264 * @param int $blog_id Blog ID.
     265 * @return bool Whether the current user can edit the `wp_global_styles` post type.
     266 */
     267function wpcom_global_styles_current_user_can_edit_wp_global_styles( $blog_id = 0 ) {
     268    if ( ! $blog_id ) {
     269        $blog_id = get_current_blog_id();
     270    }
     271    switch_to_blog( $blog_id );
     272    $wp_global_styles_cpt = get_post_type_object( 'wp_global_styles' );
     273    restore_current_blog();
     274    return current_user_can( $wp_global_styles_cpt->cap->publish_posts );
     275}
     276
     277/**
    258278 * Checks if the current blog has custom styles in use.
    259279 *
     
    310330    }
    311331
    312     switch_to_blog( $blog_id );
    313 
    314332    // If the current user cannot modify the `wp_global_styles` CPT, the exemption check is not needed;
    315333    // other conditions will determine whether they can use GS.
    316     $wp_global_styles_cpt = get_post_type_object( 'wp_global_styles' );
    317     if ( ! current_user_can( $wp_global_styles_cpt->cap->publish_posts ) ) {
    318         restore_current_blog();
    319         return false;
    320     }
     334    if ( ! wpcom_global_styles_current_user_can_edit_wp_global_styles( $blog_id ) ) {
     335        return false;
     336    }
     337
     338    switch_to_blog( $blog_id );
    321339
    322340    add_blog_sticker( 'wpcom-premium-global-styles-exemption-checked', null, null, $blog_id );
Note: See TracChangeset for help on using the changeset viewer.