bbp_current_user_can_publish_replies()
Check if the current user can publish replies
Description
Return
(bool)
Source
File: bp-forums/users/template.php
1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 | function bbp_current_user_can_publish_replies() { // Users need to earn access $retval = false; // Always allow keymasters if ( bbp_is_user_keymaster() ) { $retval = true; // Do not allow anonymous if not enabled } elseif ( !is_user_logged_in() && bbp_allow_anonymous() ) { $retval = true; // User is logged in } elseif ( current_user_can( 'publish_replies' ) ) { $retval = true; } // Allow access to be filtered return (bool) apply_filters( 'bbp_current_user_can_publish_replies' , $retval ); } |
Changelog
Version | Description |
---|---|
bbPress (r3127) | 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.