Skip to content

Instantly share code, notes, and snippets.

@hivepress
Created April 27, 2022 10:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hivepress/a6e63e8bf11a2c99bc4540ef6d31b86e to your computer and use it in GitHub Desktop.
Save hivepress/a6e63e8bf11a2c99bc4540ef6d31b86e to your computer and use it in GitHub Desktop.
Hide the Add Listing button from regular users #hivepress #listings
<?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