Changeset 1470320
- Timestamp:
- 08/08/2016 09:21:30 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
more-privacy-options/trunk/ds_wp3_private_blog.php
r1470217 r1470320 81 81 Finally, 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. 82 82 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')); 85 85 86 86 So, 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. … … 91 91 */ 92 92 93 class ds_more_privacy_options {93 class DS_More_Privacy_Options { 94 94 var $l10n_prefix; 95 95 … … 98 98 99 99 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' ) ); 101 101 return false; 102 102 } … … 107 107 //---Hooks-----------------------------------------------------------------// 108 108 //------------------------------------------------------------------------// 109 add_action( 'init', array( &$this, 'ds_localization_init' ));109 add_action( 'init', array($this, 'ds_localization_init' )); 110 110 // 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')); 113 113 114 114 // 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); 116 116 // 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); 119 119 120 120 // 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')); 122 122 123 123 // all three add_privacy_option get a redirect and a message in the Login form … … 127 127 128 128 //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') ); 134 134 } 135 135 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') ); 141 141 142 142 } 143 143 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') ); 149 149 } 150 150 151 151 // fixes robots.txt rules 152 add_action('do_robots', array( &$this, 'do_robots'),1);152 add_action('do_robots', array($this, 'do_robots'),1); 153 153 154 154 // 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); 157 157 158 158 //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); 160 160 //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')); 162 162 // hook into signup form? 163 add_action('signup_blogform', array( &$this, 'add_privacy_options'));163 add_action('signup_blogform', array($this, 'add_privacy_options')); 164 164 165 165 } … … 582 582 } 583 583 } 584 new ds_more_privacy_options();584 new DS_More_Privacy_Options(); 585 585 ?>
Note: See TracChangeset
for help on using the changeset viewer.