Created
April 27, 2022 10:37
-
-
Save hivepress/a6e63e8bf11a2c99bc4540ef6d31b86e to your computer and use it in GitHub Desktop.
Hide the Add Listing button from regular users #hivepress #listings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'option_hp_listing_enable_submission', | |
function( $value ) { | |
if ( ! is_admin() && ! current_user_can( 'edit_posts' ) ) { | |
return false; | |
} | |
return $value; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment