Plugin Directory

Changeset 1410240


Ignore:
Timestamp:
05/04/2016 10:35:05 AM (10 years ago)
Author:
smartware.cc
Message:

Version 1.1

Location:
smart-archive-page-remove
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • smart-archive-page-remove/trunk/readme.txt

    r1406210 r1410240  
    44Tags: archive page, archive pages, remove archive, remove archive pages, delete archive, delete archive pages, hide archive, hide archive pages
    55Requires at least: 3.0
    6 Tested up to: 4.3
    7 Stable tag: 1.0
     6Tested up to: 4.5
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515> This Plugin allows you to remove Archive Pages automatically generated by WordPress
    1616
    17 **See also [Plugin Homepage](http://smartware.cc/free-wordpress-plugins/404page/) and [Plugin Doc](http://smartware.cc/docs/404page/)**
     17**See also [Plugin Homepage](http://smartware.cc/free-wordpress-plugins/smart-archive-page-remove/) and [Plugin Doc](http://smartware.cc/docs/smart-archive-page-remove/)**
    1818
    1919WordPress automatically generates several archives for your posts:
     
    7474== Changelog ==
    7575
     76= 1.1 (2016-05-04) =
     77* some backend styling
     78* translations moved to GlotPress
     79* delete settings on uninstall
     80* fixed issue - settings not saved the very first time
     81
    7682= 1.0 (2015-01-24) =
    7783* Initial Release
  • smart-archive-page-remove/trunk/smart-archive-page-remove.php

    r1405710 r1410240  
    44Plugin URI: http://smartware.cc/free-wordpress-plugins/smart-archive-page-remove
    55Description: Completely remove unwated Archive Pages from your Blog
    6 Version: 1.1 beta 2
     6Version: 1.1
    77Author: smartware.cc, Peter's Plugins
    88Author URI: http://smartware.cc
     
    4646        $this->plugin_name = 'smart Archive Page Remove';
    4747    $this->plugin_slug = 'smart-archive-page-remove';
    48         $this->version = '1.1 beta 2';
     48        $this->version = '1.1';
    4949    $this->option_name = 'smart_archive_page_remove';
    5050    $this->init();
     
    5454  private function get_settings() {
    5555    $this->settings = array();
    56     $options = get_option( $this->option_name );
    57     if ( $options == '' ) {
    58       $settings = array();
    59     } else {
    60       $settings = unserialize( $options );
    61     }
     56    $settings = get_option( $this->option_name );
    6257    $defaults = array(
    6358      'author' => false,
     
    6863      'yearly' => false
    6964    );
    70     $this->settings = shortcode_atts( $defaults, $settings );
     65    if ( $settings == '' ) {
     66      $this->settings = $defaults;
     67      update_option( $this->option_name, serialize( $settings ) );
     68    } else {
     69      $this->settings = shortcode_atts( $defaults, unserialize( $settings ) );
     70    }
    7171  }
    7272 
     
    171171  // echo title for settings section
    172172  function admin_section_title() {
    173     echo '<p><strong>' . __( 'Remove the following Archive Pages', 'smart-archive-page-remove' ) . '</strong></p><hr />';
     173    echo '<p><strong>' . __( 'Remove the following Archive Pages', 'smart-archive-page-remove' ) . '</strong> <a class="dashicons dashicons-editor-help" href="' . $this->dc_url .'"></a></p><hr />';
    174174  }
    175175 
     
    279279          <div class="inside">
    280280            <ul>
    281               <li><div class="dashicons dashicons-wordpress"></div>&nbsp;&nbsp;<a href="<a href="<?php echo $this->wp_url; ?>/faq/"><?php _e( 'Take a look at the FAQ section', 'smart-archive-page-remove' ); ?></a></li>
     281              <li><div class="dashicons dashicons-book-alt"></div>&nbsp;&nbsp;<a href="<?php echo $this->dc_url; ?>"><?php _e( 'Take a look at the Plugin Doc', '404page' ); ?></a></li>
     282              <li><div class="dashicons dashicons-wordpress"></div>&nbsp;&nbsp;<a href="<?php echo $this->wp_url; ?>/faq/"><?php _e( 'Take a look at the FAQ section', 'smart-archive-page-remove' ); ?></a></li>
    282283              <li><div class="dashicons dashicons-wordpress"></div>&nbsp;&nbsp;<a href="http://wordpress.org/support/plugin/<?php echo $this->plugin_slug; ?>"><?php _e( 'Take a look at the Support section', 'smart-archive-page-remove'); ?></a></li>
    283284              <li><div class="dashicons dashicons-admin-comments"></div>&nbsp;&nbsp;<a href="http://smartware.cc/contact/"><?php _e( 'Feel free to contact the Author', 'smart-archive-page-remove' ); ?></a></li>
     
    308309    return array_merge( $links, array( '<a href="' . admin_url( 'options-general.php?page=smartarchivepageremovesettings' ) . '">' . __( 'Settings' ) . '</a>') );
    309310  }
     311 
     312   // uninstall plugin
     313  function uninstall() {
     314    if( is_multisite() ) {
     315      $this->uninstall_network();
     316    } else {
     317      $this->uninstall_single();
     318    }
     319  }
     320 
     321  // uninstall network wide
     322  function uninstall_network() {
     323    global $wpdb;
     324    $activeblog = $wpdb->blogid;
     325    $blogids = $wpdb->get_col( esc_sql( 'SELECT blog_id FROM ' . $wpdb->blogs ) );
     326    foreach ($blogids as $blogid) {
     327      switch_to_blog( $blogid );
     328      $this->uninstall_single();
     329    }
     330    switch_to_blog( $activeblog );
     331  }
     332 
     333  // uninstall single blog
     334  function uninstall_single() {
     335    delete_option( $this->option_name );
     336  }
    310337
    311338}
Note: See TracChangeset for help on using the changeset viewer.