bbPress::add_permastructs()
Add permalink structures for new archive-style destinations.
Description
- Users
- Topic Views
- Search
Source
File: bp-forums/classes/class-bbpress.php
829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 | public static function add_permastructs() { // Get unique ID's $user_id = bbp_get_user_rewrite_id(); $view_id = bbp_get_view_rewrite_id(); $search_id = bbp_get_search_rewrite_id(); // Get root slugs $user_slug = bbp_get_user_slug(); $view_slug = bbp_get_view_slug(); $search_slug = bbp_get_search_slug(); // User Permastruct add_permastruct( $user_id , $user_slug . '/%' . $user_id . '%' , array ( 'with_front' => false, 'ep_mask' => EP_NONE, 'paged' => false, 'feed' => false, 'forcomments' => false, 'walk_dirs' => true, 'endpoints' => false, ) ); // Topic View Permastruct add_permastruct( $view_id , $view_slug . '/%' . $view_id . '%' , array ( 'with_front' => false, 'ep_mask' => EP_NONE, 'paged' => false, 'feed' => false, 'forcomments' => false, 'walk_dirs' => true, 'endpoints' => false, ) ); // Search Permastruct add_permastruct( $user_id , $search_slug . '/%' . $search_id . '%' , array ( 'with_front' => false, 'ep_mask' => EP_NONE, 'paged' => true, 'feed' => false, 'forcomments' => false, 'walk_dirs' => true, 'endpoints' => false, ) ); } |
Changelog
Version | Description |
---|---|
bbPress (r4930) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.