Created
April 7, 2016 21:10
-
-
Save victorknust/0fbd264a658147a55d4009691d6250c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * | |
| */ | |
| function force_template_redirect() { | |
| if ( (is_page( 'acessar-conta' ) || is_page( 'criar-uma-conta' )) | |
| && is_user_logged_in() ) { | |
| wp_redirect( home_url( '/meus-dados/' ) ); | |
| exit(); | |
| } | |
| } | |
| add_action( 'template_redirect', 'force_template_redirect' ); | |
| function force_panel_admin_init() { | |
| if ( current_user_can( 'subscriber' ) && !defined( 'DOING_AJAX' ) ) { | |
| wp_redirect( home_url('/historico-financeiro/') ); | |
| exit; | |
| } | |
| } | |
| add_action( 'admin_init', 'force_panel_admin_init' ); | |
| //------------------------------------------------------------------------------ | |
| /* */ | |
| function add_query_vars_filter( $vars ){ | |
| $vars[] = "referrer_id"; | |
| return $vars; | |
| } | |
| add_filter( 'query_vars', 'add_query_vars_filter' ); | |
| /* */ | |
| function custom_rewrite() { | |
| flush_rewrite_rules(false); | |
| add_rewrite_rule('^convite/([0-9]+)/?', 'index.php?page_id=13&referrer_id=$matches[1]', 'top'); | |
| } | |
| add_action('init', 'custom_rewrite'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment