WordPress.org

Make WordPress Core

Changeset 10714


Ignore:
Timestamp:
03/05/09 18:45:26 (5 years ago)
Author:
ryan
Message:

Add theme delete link. Stub action. see #8678

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/themes.php

    r10713 r10714  
    1111 
    1212if ( isset($_GET['action']) ) { 
    13     check_admin_referer('switch-theme_' . $_GET['template']); 
    14  
    15     if ('activate' == $_GET['action']) { 
     13    if ( 'activate' == $_GET['action'] ) { 
     14        check_admin_referer('switch-theme_' . $_GET['template']); 
    1615        switch_theme($_GET['template'], $_GET['stylesheet']); 
    1716        wp_redirect('themes.php?activated=true'); 
    1817        exit; 
     18    } else if ( 'delete' == $_GET['action'] ) { 
     19        check_admin_referer('delete-theme_' . $_GET['template']); 
     20        die('Not implemented'); 
    1921    } 
    2022} 
     
    183185    $actions[] = '<a href="' . $activate_link .  '" title="' . $activate_text . '">' . __('Activate') . '</a>'; 
    184186    $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . attribute_escape(sprintf(__('Preview "%s"'), $theme_name)) . '">' . __('Preview') . '</a>'; 
     187    if ( current_user_can('update_themes') ) 
     188        $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template=$template", 'delete-theme_' . $template) . '" onclick="' . "if ( confirm('" . js_escape(sprintf( __("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>';    
    185189    $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]); 
    186190 
Note: See TracChangeset for help on using the changeset viewer.