Changeset 44717 for trunk/src/wp-admin/themes.php
- Timestamp:
- 01/30/2019 11:00:30 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/themes.php
r44524 r44717 33 33 switch_theme( $theme->get_stylesheet() ); 34 34 wp_redirect( admin_url( 'themes.php?activated=true' ) ); 35 exit;36 } elseif ( 'resume' === $_GET['action'] ) {37 check_admin_referer( 'resume-theme_' . $_GET['stylesheet'] );38 $theme = wp_get_theme( $_GET['stylesheet'] );39 40 if ( ! current_user_can( 'resume_themes' ) ) {41 wp_die(42 '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .43 '<p>' . __( 'Sorry, you are not allowed to resume this theme.' ) . '</p>',44 40345 );46 }47 48 $result = resume_theme( $theme->get_stylesheet() );49 50 if ( is_wp_error( $result ) ) {51 wp_die( $result );52 }53 54 wp_redirect( admin_url( 'themes.php?resumed=true' ) );55 35 exit; 56 36 } elseif ( 'delete' == $_GET['action'] ) { … … 216 196 <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div> 217 197 <?php 218 } elseif ( isset( $_GET['resumed'] ) ) {219 ?>220 <div id="message5" class="updated notice is-dismissible"><p><?php _e( 'Theme resumed.' ); ?></p></div>221 <?php222 198 } 223 199 … … 373 349 374 350 <?php 375 $can_resume = current_user_can( 'resume_themes' );376 351 $can_delete = current_user_can( 'delete_themes' ); 377 352 $can_install = current_user_can( 'install_themes' ); … … 381 356 <th><?php _ex( 'Name', 'theme name' ); ?></th> 382 357 <th><?php _e( 'Description' ); ?></th> 383 <?php if ( $can_resume ) { ?>384 <td></td>385 <?php } ?>386 358 <?php if ( $can_delete ) { ?> 387 359 <td></td> … … 396 368 <td><?php echo $broken_theme->errors()->get_error_message(); ?></td> 397 369 <?php 398 if ( $can_resume ) {399 if ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) {400 $stylesheet = $broken_theme->get_stylesheet();401 $resume_url = add_query_arg(402 array(403 'action' => 'resume',404 'stylesheet' => urlencode( $stylesheet ),405 ),406 admin_url( 'themes.php' )407 );408 $resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet );409 ?>410 <td><a href="<?php echo esc_url( $resume_url ); ?>" class="button resume-theme"><?php _e( 'Resume' ); ?></a></td>411 <?php412 } else {413 ?>414 <td></td>415 <?php416 }417 }418 419 370 if ( $can_delete ) { 420 371 $stylesheet = $broken_theme->get_stylesheet();
Note: See TracChangeset
for help on using the changeset viewer.