Changeset 2868945
- Timestamp:
- 02/21/2023 06:11:48 PM (3 years ago)
- Location:
- full-site-editing/trunk
- Files:
-
- 4 edited
-
build_meta.txt (modified) (1 diff)
-
full-site-editing-plugin.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
wpcom-global-styles/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
full-site-editing/trunk/build_meta.txt
r2868790 r2868945 1 commit_hash= d6273a1114cf166cc5b91cf85b4e26e13244a6d02 commit_url=https://github.com/Automattic/wp-calypso/commit/ d6273a1114cf166cc5b91cf85b4e26e13244a6d03 build_number=3.5 69631 commit_hash=e40203ed2a04685a44bd0850e5381f95d056603f 2 commit_url=https://github.com/Automattic/wp-calypso/commit/e40203ed2a04685a44bd0850e5381f95d056603f 3 build_number=3.57000 -
full-site-editing/trunk/full-site-editing-plugin.php
r2868790 r2868945 3 3 * Plugin Name: WordPress.com Editing Toolkit 4 4 * Description: Enhances your page creation workflow within the Block Editor. 5 * Version: 3.5 69635 * Version: 3.57000 6 6 * Author: Automattic 7 7 * Author URI: https://automattic.com/wordpress-plugins/ … … 43 43 * @var string 44 44 */ 45 define( 'A8C_ETK_PLUGIN_VERSION', '3.5 6963' );45 define( 'A8C_ETK_PLUGIN_VERSION', '3.57000' ); 46 46 47 47 // Always include these helper files for dotcom FSE. -
full-site-editing/trunk/readme.txt
r2868790 r2868945 4 4 Requires at least: 5.5 5 5 Tested up to: 6.0 6 Stable tag: 3.5 69636 Stable tag: 3.57000 7 7 Requires PHP: 5.6.20 8 8 License: GPLv2 or later -
full-site-editing/trunk/wpcom-global-styles/index.php
r2868773 r2868945 144 144 */ 145 145 function 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 ) { 147 151 return; 148 152 } … … 256 260 257 261 /** 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 */ 267 function 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 /** 258 278 * Checks if the current blog has custom styles in use. 259 279 * … … 310 330 } 311 331 312 switch_to_blog( $blog_id );313 314 332 // If the current user cannot modify the `wp_global_styles` CPT, the exemption check is not needed; 315 333 // 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 ); 321 339 322 340 add_blog_sticker( 'wpcom-premium-global-styles-exemption-checked', null, null, $blog_id );
Note: See TracChangeset
for help on using the changeset viewer.