Changeset 41626 for trunk/src/wp-admin/customize.php
- Timestamp:
- 09/27/2017 10:24:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/customize.php
r41374 r41626 28 28 29 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() ) ) { 30 $changeset_post = get_post( $wp_customize->changeset_post_id() ); 31 32 if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $changeset_post->ID ) ) { 31 33 wp_die( 32 34 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . … … 35 37 ); 36 38 } 37 if ( in_array( get_post_status( $wp_customize->changeset_post_id() ), array( 'publish', 'trash' ), true ) ) { 39 40 $missed_schedule = ( 41 'future' === $changeset_post->post_status && 42 get_post_time( 'G', true, $changeset_post ) < time() 43 ); 44 if ( $missed_schedule ) { 45 wp_publish_post( $changeset_post->ID ); 46 wp_die( 47 '<h1>' . __( 'Your scheduled changes just published' ) . '</h1>' . 48 '<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>', 49 200 50 ); 51 } 52 53 if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) { 38 54 wp_die( 39 55 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . … … 133 149 <form id="customize-controls" class="wrap wp-full-overlay-sidebar"> 134 150 <div id="customize-header-actions" class="wp-full-overlay-header"> 135 <?php 136 $save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' ); 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 ); 142 ?> 151 <?php $save_text = $wp_customize->is_theme_active() ? __( 'Publish' ) : __( 'Activate & Publish' ); ?> 152 <div id="customize-save-button-wrapper" class="customize-save-button-wrapper" > 153 <?php submit_button( $save_text, 'primary save', 'save', false ); ?> 154 <button id="publish-settings" class="publish-settings button-primary button dashicons dashicons-admin-generic" aria-label="<?php esc_attr_e( 'Publish Settings' ); ?>" aria-expanded="false" disabled></button> 155 </div> 143 156 <span class="spinner"></span> 144 157 <button type="button" class="customize-controls-preview-toggle"> … … 204 217 </form> 205 218 <div id="customize-preview" class="wp-full-overlay-main"></div> 219 <div id="customize-sidebar-outer-content"> 220 <div id="customize-outer-theme-controls-wrapper"> 221 <div id="customize-outer-theme-controls"> 222 <ul class="customize-outer-pane-parent"><?php // Outer panel and sections are not implemented, but its here as a placeholder to avoid any side-effect in api.Section. ?></ul> 223 </div> 224 </div> 225 </div> 206 226 <?php 207 227
Note: See TracChangeset
for help on using the changeset viewer.