ap_answers_tab( string|boolean $base = false )
Description #
Output answers tab.
Parameters #
- $basestring | boolean (Optional) Current page url. Default value: false
Source #
File: includes/theme.php
function ap_answers_tab( $base = false ) { $sort = ap_sanitize_unslash( 'order_by', 'r', ap_opt( 'answers_sort' ) ); if ( ! $base ) { $base = get_permalink(); } $navs = array( 'active' => array( 'link' => add_query_arg( array( 'order_by' => 'active' ), $base ), 'title' => __( 'Active', 'anspress-question-answer' ), ), ); if ( ! ap_opt( 'disable_voting_on_answer' ) ) { $navs['voted'] = array( 'link' => add_query_arg( array( 'order_by' => 'voted' ), $base ), 'title' => __( 'Voted', 'anspress-question-answer' ), ); } $navs['newest'] = array( 'link' => add_query_arg( array( 'order_by' => 'newest' ), $base ), 'title' => __( 'Newest', 'anspress-question-answer' ), ); $navs['oldest'] = array( 'link' => add_query_arg( array( 'order_by' => 'oldest' ), $base ), 'title' => __( 'Oldest', 'anspress-question-answer' ), ); echo '<ul id="answers-order" class="ap-answers-tab ap-ul-inline clearfix">'; foreach ( (array) $navs as $k => $nav ) { echo '<li' . ( $sort === $k ? ' class="active"' : '' ) . '><a href="' . esc_url( $nav['link'] . '#answers-order' ) . '">' . esc_attr( $nav['title'] ) . '</a></li>'; } echo '</ul>'; }
Expand full source code Collapse full source code View on GitHub: includes/theme.php:469
Add your comment