- Timestamp:
- 03/15/2023 08:16:46 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/classes/class-bp-members-component.php
r13433 r13436 215 215 public function setup_additional_globals() { 216 216 $bp = buddypress(); 217 218 // Set-up Extra permastructs for the register and activate pages. 219 $this->register_permastruct = bp_get_signup_slug() . '/%' . $this->rewrite_ids['member_register'] . '%'; 220 $this->activate_permastruct = bp_get_activate_slug() . '/%' . $this->rewrite_ids['member_activate'] . '%'; 217 221 218 222 /** Logged in user *************************************************** … … 784 788 785 789 /** 790 * Add the Registration and Activation rewrite tags. 791 * 792 * @since 12.0.0 793 * 794 * @param array $rewrite_tags Optional. See BP_Component::add_rewrite_tags() for 795 * description. 796 */ 797 public function add_rewrite_tags( $rewrite_tags = array() ) { 798 $rewrite_tags = array( 799 'member_register' => '([1]{1,})', 800 'member_activate' => '([1]{1,})', 801 'member_activate_key' => '([^/]+)', 802 ); 803 804 parent::add_rewrite_tags( $rewrite_tags ); 805 } 806 807 /** 808 * Add the Registration and Activation rewrite rules. 809 * 810 * @since 12.0.0 811 * 812 * @param array $rewrite_rules Optional. See BP_Component::add_rewrite_rules() for 813 * description. 814 */ 815 public function add_rewrite_rules( $rewrite_rules = array() ) { 816 $rewrite_rules = array( 817 'directory_type' => array( 818 'regex' => $this->root_slug . '/' . bp_get_members_member_type_base() . '/([^/]+)/?$', 819 'order' => 50, 820 'query' => 'index.php?' . $this->rewrite_ids['directory'] . '=1&' . $this->rewrite_ids['directory_type'] . '=$matches[1]', 821 ), 822 'member_activate' => array( 823 'regex' => bp_get_activate_slug(), 824 'order' => 40, 825 'query' => 'index.php?' . $this->rewrite_ids['member_activate'] . '=1', 826 ), 827 'member_activate_key' => array( 828 'regex' => bp_get_activate_slug() . '/([^/]+)/?$', 829 'order' => 30, 830 'query' => 'index.php?' . $this->rewrite_ids['member_activate'] . '=1&' . $this->rewrite_ids['member_activate_key'] . '=$matches[1]', 831 ), 832 'member_register' => array( 833 'regex' => bp_get_signup_slug(), 834 'order' => 20, 835 'query' => 'index.php?' . $this->rewrite_ids['member_register'] . '=1', 836 ), 837 ); 838 839 parent::add_rewrite_rules( $rewrite_rules ); 840 } 841 842 /** 843 * Add the Registration and Activation permastructs. 844 * 845 * @since 12.0.0 846 * 847 * @param array $permastructs Optional. See BP_Component::add_permastructs() for 848 * description. 849 */ 850 public function add_permastructs( $permastructs = array() ) { 851 $permastructs = array( 852 // Register permastruct. 853 $this->rewrite_ids['member_register'] => array( 854 'permastruct' => $this->register_permastruct, 855 'args' => array(), 856 ), 857 // Activate permastruct. 858 $this->rewrite_ids['member_activate'] => array( 859 'permastruct' => $this->activate_permastruct, 860 'args' => array(), 861 ), 862 ); 863 864 parent::add_permastructs( $permastructs ); 865 } 866 867 /** 786 868 * Init the BP REST API. 787 869 *
Note: See TracChangeset
for help on using the changeset viewer.