Profile::rewrite_rules( array $rules, string $slug, integer $base_page_id )
Description #
Add category pages rewrite rule.
Parameters #
- $rulesarray (Required) AnsPress rules.
- $slugstring (Required) Slug.
- $base_page_idinteger (Required) Base page ID.
Source #
File: addons/profile/profile.php
public function rewrite_rules( $rules, $slug, $base_page_id ) { $base_slug = get_page_uri( ap_opt( 'user_page' ) ); update_option( 'ap_user_path', $base_slug, true ); $new_rules = array(); $new_rules = array( $base_slug . '/([^/]+)/([^/]+)/page/?([0-9]{1,})/?' => 'index.php?author_name=$matches[#]&ap_page=user&user_page=$matches[#]&ap_paged=$matches[#]', $base_slug . '/([^/]+)/([^/]+)/?' => 'index.php?author_name=$matches[#]&ap_page=user&user_page=$matches[#]', $base_slug . '/([^/]+)/?' => 'index.php?author_name=$matches[#]&ap_page=user', $base_slug . '/?' => 'index.php?ap_page=user', ); return $new_rules + $rules; }
Expand full source code Collapse full source code View on GitHub: addons/profile/profile.php:139
Add your comment