ap_user_can_toggle_featured( integer|boolean $user_id = false )
Description #
Check if user can toggle featured question.
Parameters #
- $user_idinteger | boolean (Optional) User ID. Default value: false
Source #
File: includes/class/roles-cap.php
function ap_user_can_toggle_featured( $user_id = false ) { if ( false === $user_id ) { $user_id = get_current_user_id(); } /** * Filter to hijack ap_user_can_toggle_featured. * * @param boolean|string $apply_filter Apply current filter, empty string by default. * @param integer $user_id User ID. * @return boolean * @since 3.0.0 */ $filter = apply_filters( 'ap_user_can_toggle_featured', '', $user_id ); if ( true === $filter ) { return true; } elseif ( false === $filter ) { return false; } if ( is_super_admin( $user_id ) || user_can( $user_id, 'ap_toggle_featured' ) ) { return true; } return false; }
Expand full source code Collapse full source code View on GitHub: includes/class/roles-cap.php:1410
Add your comment