WordPress.org

Plugin Directory

Changeset 525737


Ignore:
Timestamp:
04/01/12 03:07:41 (2 years ago)
Author:
dllh
Message:

Implement link deletion. This doesn't yet delete link categories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • empty-blog/trunk/empty-blog.php

    r524101 r525737  
    112112            } 
    113113        } 
     114         
     115        // Links 
     116        if ( isset( $_POST['delete_links'] ) && 1 == $_POST['delete_links'] ) { 
     117            print "<h3>" . __( "Deleting links." ) . "</h3>\n"; 
     118            $links = get_bookmarks(); 
     119            foreach ( $links as $link ) { 
     120                print __( "Link" ) . ": <a href='" . $link->link_url . "'>" . $link->link_name . "</a><br />"; 
     121                wp_delete_link( $link->link_id ); 
     122            } 
     123        }        
    114124        _e( "Blog empty completed." ); 
    115125    } 
     
    119129            div.empty_blog_field{ padding-bottom: 8px; } 
    120130            div#empty_blog_controls p.warn { 
    121                 border: 2px solid #000; 
     131                border: 1px solid #000; 
    122132                padding: 8px; 
    123                 width: 500px; 
     133                width: 60%; 
    124134                background-color: #FABECD; 
    125135                color: #000; 
    126136                font-size: 1.3em; 
    127137                line-height: 170%; 
     138                border-radius: 6px 6px 6px 6px; 
    128139            } 
    129140            div.empty_blog_field_group { 
     
    137148        <div id="empty_blog_controls"> 
    138149        <h2><?php _e( 'Empty Blog' ); ?></h2> 
    139         <p class="warn"><?php _e( "Pushing the button below will irretrievably empty your blog of pages, posts, attachments, comments, categories, and tags. Don't push it unless you really mean it!" ); ?></p> 
     150        <p class="warn"><?php _e( "Pushing the button below will <strong>irretrievably empty your blog</strong> of pages, posts, attachments, comments, categories, and tags. Don't push it unless you really mean it!" ); ?></p> 
    140151        <form method="post" onsubmit="return confirm( '<?php esc_attr_e( 'Are you sure?' ); ?>' )"> 
    141152        <?php wp_nonce_field( 'empty-blog' ); ?> 
     
    150161        <div class="empty_blog_field"><input type="checkbox" id="delete_tags" name="delete_tags" value="1" /> <label for="delete_tags"><?php _e( 'Delete Tags' ); ?></label></div> 
    151162        <div class="empty_blog_field"><input type="checkbox" id="delete_categories" name="delete_categories" value="1" /> <label for="delete_categories"><?php _e( 'Delete Categories' ); ?></label></div> 
     163        <div class="empty_blog_field"><input type="checkbox" id="delete_links" name="delete_links" value="1" /> <label for="delete_links"><?php _e( 'Delete Links' ); ?></label></div> 
    152164        <div class="empty_blog_field"><input type="submit" id="empty" name="empty" value="<?php esc_attr_e( 'Empty Blog' ); ?>" /></div> 
    153165        </form> 
Note: See TracChangeset for help on using the changeset viewer.