Changeset 35187
- Timestamp:
- 10/15/2015 05:10:32 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/themes.php
r34994 r35187 301 301 <?php 302 302 $can_delete = current_user_can( 'delete_themes' ); 303 $can_install = current_user_can( 'install_themes' ); 303 304 ?> 304 305 <table> … … 307 308 <th><?php _e('Description'); ?></th> 308 309 <?php if ( $can_delete ) { ?> 310 <td></td> 311 <?php } ?> 312 <?php if ( $can_install ) { ?> 309 313 <td></td> 310 314 <?php } ?> … … 326 330 <?php 327 331 } 332 333 if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) { 334 $parent_theme_name = $broken_theme->get( 'Template' ); 335 $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) ); 336 337 if ( ! is_wp_error( $parent_theme ) ) { 338 $install_url = add_query_arg( array( 339 'action' => 'install-theme', 340 'theme' => urlencode( $parent_theme_name ), 341 ), admin_url( 'update.php' ) ); 342 $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name ); 343 ?> 344 <td><a href="<?php echo esc_url( $install_url ); ?>" class="button button-secondary install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td> 345 <?php 346 } 347 } 328 348 ?> 329 349 </tr>
Note: See TracChangeset
for help on using the changeset viewer.