WordPress.org

Plugin Directory

Changeset 705253


Ignore:
Timestamp:
04/29/13 07:29:51 (5 years ago)
Author:
cnorris23
Message:

Sync trunk

Location:
edit-author-slug
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • edit-author-slug/tags/0.9.5/edit-author-slug.php

    r705251 r705253  
    250250    do_action( 'ba_eas_deactivation' ); 
    251251 
    252  
    253252    // Courtesy flush 
    254253    delete_option( 'rewrite_rules' ); 
  • edit-author-slug/trunk/edit-author-slug.php

    r661637 r705253  
    1616 * Plugin URI: http://brandonallen.org/wordpress/plugins/edit-author-slug/ 
    1717 * Description: Allows an Admin (or capable user) to edit the author slug of a user, and change the Author Base. <em>i.e. - (WordPress default structure) http://example.com/author/username/ (Plugin allows) http://example.com/ninja/master-ninja/</em> 
    18  * Version: 0.9.4 
    19  * Tested With: 3.2.1, 3.3.2, 3.4, 3.5.1 
     18 * Version: 0.9.5 
     19 * Tested With: 3.2.1, 3.3.2, 3.4, 3.5.1, 3.6 
    2020 * Author: Brandon Allen 
    2121 * Author URI: http://brandonallen.org/ 
     
    2424 
    2525/* 
    26             Copyright 2011  Brandon Allen  (email : wp_plugins ([at]) brandonallen ([dot]) org) 
     26            Copyright 2013  Brandon Allen  (email : wp_plugins ([at]) brandonallen ([dot]) org) 
    2727 
    2828            This program is free software; you can redistribute it and/or modify 
     
    5858     * @var string Edit Author Slug Version 
    5959     */ 
    60     public $version = '0.9.4'; 
     60    public $version = '0.9.5'; 
    6161 
    6262    /** 
     
    6565     * @var int Edit Author Slug DB Version 
    6666     */ 
    67     public $db_version = 132; 
     67    public $db_version = 158; 
    6868 
    6969    /** 
     
    216216        global $wp_rewrite; 
    217217 
    218         if ( !empty( $this->author_base ) || 'author' != $this->author_base ) 
     218        if ( !empty( $this->author_base ) && 'author' != $this->author_base ) 
    219219            $wp_rewrite->author_base = $this->author_base; 
    220220    } 
     
    235235function ba_eas_activation() { 
    236236    do_action( 'ba_eas_activation' ); 
     237 
     238    // Pre-emptive courtesy flush in case of existing author base 
     239    ba_eas_flush_rewrite_rules(); 
    237240} 
    238241 
     
    248251 
    249252    // Courtesy flush 
    250     flush_rewrite_rules( false ); 
     253    delete_option( 'rewrite_rules' ); 
    251254} 
    252255 
  • edit-author-slug/trunk/includes/admin-functions.php

    r661629 r705253  
    310310        $author_base = 'author'; 
    311311 
    312  
    313312    // Do we need to update the author_base 
    314313    if ( $author_base != $ba_eas->author_base ) { 
     
    322321        if ( !empty( $ba_eas->author_base ) ) 
    323322            $wp_rewrite->author_base = $ba_eas->author_base; 
    324  
    325         // Courtesy flush 
    326         flush_rewrite_rules( false ); 
    327     } 
     323    } 
     324 
     325    // Courtesy flush 
     326    ba_eas_flush_rewrite_rules(); 
    328327 
    329328    return $author_base; 
     
    546545        return; 
    547546 
     547    if ( $ba_eas->current_db_version < 158 ) { 
     548        // Courtesy flush for those having issues 
     549        ba_eas_flush_rewrite_rules(); 
     550    } 
     551 
    548552    if ( $ba_eas->current_db_version < 132 ) { 
    549553        // Add new options 
  • edit-author-slug/trunk/includes/general-functions.php

    r557151 r705253  
    159159 
    160160    // Add it back in case other plugins do some updating 
    161     remove_action( 'profile_update', 'ba_eas_auto_update_user_nicename_single' ); 
     161    add_action( 'profile_update', 'ba_eas_auto_update_user_nicename_single' ); 
    162162 
    163163    return $user_id; 
     
    194194} 
    195195 
     196/** 
     197 * Delete WP generated rewrite rules from database. 
     198 * 
     199 * Rules will be recreated on next page load. 
     200 * 
     201 * @since 0.9.5 
     202 * 
     203 * @uses delete_option() To auto-update the nicename 
     204 */ 
     205function ba_eas_flush_rewrite_rules() { 
     206    delete_option( 'rewrite_rules' ); 
     207} 
     208 
    196209?> 
Note: See TracChangeset for help on using the changeset viewer.