AnsPress_PostTypes::question_perm_structure()
Description #
Return question permalink structure.
Source #
File: includes/post-types.php
public static function question_perm_structure() { $question_permalink = ap_opt( 'question_page_permalink' ); $question_slug = ap_get_page_slug( 'question' ); $rewrites = array(); if ( 'question_perma_2' === $question_permalink ) { $rewrites['rule'] = $question_slug . '/%question%'; } elseif ( 'question_perma_3' === $question_permalink ) { $rewrites['rule'] = $question_slug . '/%question_id%'; } elseif ( 'question_perma_4' === $question_permalink ) { $rewrites['rule'] = $question_slug . '/%question_id%/%question%'; } elseif ( 'question_perma_5' === $question_permalink ) { $rewrites['rule'] = $question_slug . '/%question%/%question_id%'; } elseif ( 'question_perma_6' === $question_permalink ) { $rewrites['rule'] = $question_slug . '/%question_id%-%question%'; } elseif ( 'question_perma_7' === $question_permalink ) { $rewrites['rule'] = $question_slug . '/%question%-%question_id%'; } else { $rewrites['rule'] = ap_base_page_slug() . '/' . $question_slug . '/%question%'; } /** * Allows filtering question permalink structure. * * @param array $rewrite Question permalink structure. * @since 4.1.0 */ return (object) apply_filters( 'ap_question_perm_structure', $rewrites ); }
Expand full source code Collapse full source code View on GitHub: includes/post-types.php:41
Add your comment