Changeset 38810 for trunk/src/wp-admin/customize.php
- Timestamp:
- 10/18/2016 08:04:36 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/customize.php
r38672 r38810 21 21 } 22 22 23 /** 24 * @global WP_Scripts $wp_scripts 25 * @global WP_Customize_Manager $wp_customize 26 */ 27 global $wp_scripts, $wp_customize; 28 29 if ( $wp_customize->changeset_post_id() ) { 30 if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $wp_customize->changeset_post_id() ) ) { 31 wp_die( 32 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 33 '<p>' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '</p>', 34 403 35 ); 36 } 37 if ( in_array( get_post_status( $wp_customize->changeset_post_id() ), array( 'publish', 'trash' ), true ) ) { 38 wp_die( 39 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 40 '<p>' . __( 'This changeset has already been published and cannot be further modified.' ) . '</p>' . 41 '<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>', 42 403 43 ); 44 } 45 } 46 47 23 48 wp_reset_vars( array( 'url', 'return', 'autofocus' ) ); 24 49 if ( ! empty( $url ) ) { … … 31 56 $wp_customize->set_autofocus( wp_unslash( $autofocus ) ); 32 57 } 33 34 /**35 * @global WP_Scripts $wp_scripts36 * @global WP_Customize_Manager $wp_customize37 */38 global $wp_scripts, $wp_customize;39 58 40 59 $registered = $wp_scripts->registered; … … 116 135 <?php 117 136 $save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' ); 118 submit_button( $save_text, 'primary save', 'save', false ); 137 $save_attrs = array(); 138 if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->publish_posts ) ) { 139 $save_attrs['style'] = 'display: none'; 140 } 141 submit_button( $save_text, 'primary save', 'save', false, $save_attrs ); 119 142 ?> 120 143 <span class="spinner"></span>
Note: See TracChangeset
for help on using the changeset viewer.