ap_flag_btn_args( mixed $post = null )
Description #
Flag button html.
Parameters #
- $postmixed (Optional) Post. Default value: null
Source #
File: includes/flag.php
function ap_flag_btn_args( $post = null ) { if ( ! is_user_logged_in() ) { return; } $_post = ap_get_post( $post ); $flagged = ap_is_user_flagged( $_post ); $title = ( ! $flagged ) ? ( __( 'Flag this post', 'anspress-question-answer' ) ) : ( __( 'You have flagged this post', 'anspress-question-answer' ) ); $actions['close'] = array( 'cb' => 'flag', 'icon' => 'apicon-check', 'query' => array( '__nonce' => wp_create_nonce( 'flag_' . $_post->ID ), 'post_id' => $_post->ID, ), 'label' => __( 'Flag', 'anspress-question-answer' ), 'title' => $title, 'count' => $_post->flags, 'active' => $flagged, ); return $actions['close']; }
Expand full source code Collapse full source code View on GitHub: includes/flag.php:123
Add your comment