WUWUWU`0WUp8 =0WU@ =pWUpH ;PWUpP t WU  <pWU P uWUP` uWU`puWUpuWU0 pWU0PuWU`AWU pWU*WUp+0WUpP=WUPAWUp`uWUPPWUpP0WUpX=WUPAWUp`AWUpWU`p0WUp `=0WUh=WUPAWUP` uWU`p!uWUp"uWUpWUP"uWUP`$AWUsWU (>XUTXU&(2XU8XU`XU8XU8XUTXU`XU8XU8XUTXU8XU8XU5XUpXU2XU`XU8XU8XUUXU`XUTXU`XUVXU5XU2XU`XUUXU in the front end of the site. Default false. * @type bool $internal Whether the status is for internal use only. * Default false. * @type bool $protected WhetWUP$?WU`$?WU` p$@0WUP &=WUPP&uWU `&AWU p&AWU &AWU&AWU&PWU&PWU({ _WU@(+"WU`)0WUP-=WU@P-AWU0`-AWUp-uWU -PWU -WUp@9+0WU09=02WUP96`WUPpP97'WUP`@98@WU@P9AWU0`9A WUp9<EWUp9pWU@9*WU9WU9WU:+0WUpp;=WUP;uWU`;uWU;PWU;0WUp <=WUP<u WU`<3@WU`<AWU<PWU<pWU@:*WU`>WUAMFWU`ANWUA0WU(B=0WUp0B=WUPBuWUP`BAWU0BWU 0@B0{WU@PB@WUPPBAWU`Bu WUpBCWU`BbWU``pB.WU`BQgWUpB4 _WUpB+ 'help' => array( 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Block default', 'wp-hide-security-enhancer'), 'description' => __("After changing the default author, the old url is still accessible, this provide a way to block it.
The functionality apply only if New Author Path option is filled in.", 'wp-hide-security-enhancer'), 'option_documentation_url' => 'https://wp-hide.com/documentation/rewrite-author/' ), 'input_type' => 'radio', 'options' => array( 'no' => __('No', 'wp-hide-security-enhancer'), 'yes' => __('Yes', 'wp-hide-security-enhancer'), ), 'default_value' => 'no', 'sanitize_type' => array('sanitize_title', 'strtolower'), 'processing_order' => 61 ); return $this->module_settings; } function _init_author( $saved_field_data ) { add_filter('author_rewrite_rules', array( $this, 'author_rewrite_rules'), 999); if(empty($saved_field_data)) return FALSE; //add default plugin path replacement $url = trailingslashit( site_url() ) . 'author'; $replacement = trailingslashit( home_url() ) . $saved_field_data; $this->wph->functions->add_replacement( $url , $replacement ); return TRUE; } /** * Rewrite the default Author url * * @param mixed $author_rewrite */ function author_rewrite_rules( $author_rewrite ) { $new_author_path = $this->wph->functions->get_module_item_setting('author'); if( empty( $new_author_path ) ) return $author_rewrite; $author_block_default = $this->wph->functions->get_module_item_setting('author_block_default'); $new_rules = array(); foreach ( $author_rewrite as $key => $value ) { $new_rules[ str_replace( 'author/', $new_author_path .'/' , $key ) ] = $value; } if ( $author_block_default == 'yes') $author_rewrite = $new_rules; else $author_rewrite = array_merge ( $author_rewrite, $new_rules ); return $author_rewrite; } } ?>