Plugin Directory

Changeset 1470320


Ignore:
Timestamp:
08/08/2016 09:21:30 PM (10 years ago)
Author:
dsader
Message:

WP 4.6 tests OK, cleanup php notices

File:
1 edited

Legend:

Unmodified
Added
Removed
  • more-privacy-options/trunk/ds_wp3_private_blog.php

    r1470217 r1470320  
    8181Finally, changing the hook to fire at send_headers rather than template_redirect allows the activation page on every site. Still shows template pages with headers/sidebars etc - so not ideal either. Hence my preference to redirect to the main site.
    8282
    83 //          //  add_action('template_redirect', array(&$this, 'ds_users_authenticator'));
    84                 add_action('send_headers', array(&$this, 'ds_users_authenticator'));
     83//          //  add_action('template_redirect', array($this, 'ds_users_authenticator'));
     84                add_action('send_headers', array($this, 'ds_users_authenticator'));
    8585
    8686So, I have the private functions the way I actually use them on my private sites/networks. I also do many activations as the SiteAdmin manually using other plugins.
     
    9191*/
    9292
    93 class ds_more_privacy_options {
     93class DS_More_Privacy_Options {
    9494        var $l10n_prefix;
    9595
     
    9898       
    9999        if ( ! is_multisite() ) {
    100             add_action( 'all_admin_notices', array( &$this, 'display_not_multisite_notice' ) );
     100            add_action( 'all_admin_notices', array( $this, 'display_not_multisite_notice' ) );
    101101            return false;
    102102        }
     
    107107        //---Hooks-----------------------------------------------------------------//
    108108        //------------------------------------------------------------------------//
    109                 add_action( 'init', array(&$this, 'ds_localization_init' ));
     109                add_action( 'init', array($this, 'ds_localization_init' ));
    110110            // Network->Settings
    111                 add_action( 'update_wpmu_options', array(&$this, 'sitewide_privacy_update'));
    112                 add_action( 'wpmu_options', array(&$this, 'sitewide_privacy_options_page'));
     111                add_action( 'update_wpmu_options', array($this, 'sitewide_privacy_update'));
     112                add_action( 'wpmu_options', array($this, 'sitewide_privacy_options_page'));
    113113           
    114114            // hooks into Misc Blog Actions in Network->Sites->Edit
    115                 add_action('wpmueditblogaction', array(&$this, 'wpmu_blogs_add_privacy_options'),-999);
     115                add_action('wpmueditblogaction', array($this, 'wpmu_blogs_add_privacy_options'),-999);
    116116            // hooks into Blog Columns views Network->Sites
    117                 //add_filter( 'manage_sites-network_columns', array( &$this, 'add_sites_column' ), 10, 1);
    118                 //add_action( 'manage_sites_custom_column', array( &$this, 'manage_sites_custom_column' ), 10, 3);
     117                //add_filter( 'manage_sites-network_columns', array( $this, 'add_sites_column' ), 10, 1);
     118                //add_action( 'manage_sites_custom_column', array( $this, 'manage_sites_custom_column' ), 10, 3);
    119119
    120120            // hook into options-reading.php Dashboard->Settings->Reading.
    121                 add_action('blog_privacy_selector', array(&$this, 'add_privacy_options'));
     121                add_action('blog_privacy_selector', array($this, 'add_privacy_options'));
    122122
    123123            // all three add_privacy_option get a redirect and a message in the Login form
     
    127127           
    128128            //wp_is_mobile() ? is send_headers or template_redirect better for mobiles?
    129                 add_action('template_redirect', array(&$this, 'ds_users_authenticator'));
    130             //  add_action('send_headers', array(&$this, 'ds_users_authenticator'));
    131                 add_action('login_form', array(&$this, 'registered_users_login_message'));
    132                 add_filter('privacy_on_link_title', array(&$this, 'registered_users_header_title'));
    133                 add_filter('privacy_on_link_text', array(&$this, 'registered_users_header_link') );
     129                add_action('template_redirect', array($this, 'ds_users_authenticator'));
     130            //  add_action('send_headers', array($this, 'ds_users_authenticator'));
     131                add_action('login_form', array($this, 'registered_users_login_message'));
     132                add_filter('privacy_on_link_title', array($this, 'registered_users_header_title'));
     133                add_filter('privacy_on_link_text', array($this, 'registered_users_header_link') );
    134134        }
    135135        if ( '-2' == $current_blog->public ) {
    136                 add_action('template_redirect', array(&$this, 'ds_members_authenticator'));
    137             //  add_action('send_headers', array(&$this, 'ds_members_authenticator'));
    138                 add_action('login_form', array(&$this, 'registered_members_login_message'));
    139                 add_filter('privacy_on_link_title', array(&$this, 'registered_members_header_title'));
    140                 add_filter('privacy_on_link_text', array(&$this, 'registered_members_header_link') );
     136                add_action('template_redirect', array($this, 'ds_members_authenticator'));
     137            //  add_action('send_headers', array($this, 'ds_members_authenticator'));
     138                add_action('login_form', array($this, 'registered_members_login_message'));
     139                add_filter('privacy_on_link_title', array($this, 'registered_members_header_title'));
     140                add_filter('privacy_on_link_text', array($this, 'registered_members_header_link') );
    141141
    142142        }
    143143        if ( '-3' == $current_blog->public ) {
    144                 add_action('template_redirect', array(&$this, 'ds_admins_authenticator'));
    145             //  add_action('send_headers', array(&$this, 'ds_admins_authenticator'));
    146                 add_action('login_form', array(&$this, 'registered_admins_login_message'));
    147                 add_filter('privacy_on_link_title', array(&$this, 'registered_admins_header_title'));
    148                 add_filter('privacy_on_link_text', array(&$this, 'registered_admins_header_link') );
     144                add_action('template_redirect', array($this, 'ds_admins_authenticator'));
     145            //  add_action('send_headers', array($this, 'ds_admins_authenticator'));
     146                add_action('login_form', array($this, 'registered_admins_login_message'));
     147                add_filter('privacy_on_link_title', array($this, 'registered_admins_header_title'));
     148                add_filter('privacy_on_link_text', array($this, 'registered_admins_header_link') );
    149149        }
    150150
    151151            // fixes robots.txt rules
    152                 add_action('do_robots', array(&$this, 'do_robots'),1);
     152                add_action('do_robots', array($this, 'do_robots'),1);
    153153
    154154            // fixes noindex meta as well
    155                 add_action('wp_head', array(&$this, 'noindex'),0);
    156                 add_action('login_head', array(&$this, 'noindex'),1);
     155                add_action('wp_head', array($this, 'noindex'),0);
     156                add_action('login_head', array($this, 'noindex'),1);
    157157
    158158            //no pings unless public either
    159                 add_filter('option_ping_sites', array(&$this, 'privacy_ping_filter'),1);
     159                add_filter('option_ping_sites', array($this, 'privacy_ping_filter'),1);
    160160            //email SuperAdmin when privacy changes
    161                 add_action( 'update_blog_public', array(&$this,'ds_mail_super_admin'));
     161                add_action( 'update_blog_public', array($this,'ds_mail_super_admin'));
    162162            // hook into signup form?
    163                  add_action('signup_blogform', array(&$this, 'add_privacy_options'));
     163                 add_action('signup_blogform', array($this, 'add_privacy_options'));
    164164
    165165    }
     
    582582    }
    583583}
    584 new ds_more_privacy_options(); 
     584new DS_More_Privacy_Options(); 
    585585?>
Note: See TracChangeset for help on using the changeset viewer.