Skip to content

Instantly share code, notes, and snippets.

@marklchaves
Created March 27, 2025 03:29
Show Gist options
  • Save marklchaves/2c3801b50a5b1ec6d6509f37e366f7e4 to your computer and use it in GitHub Desktop.
Save marklchaves/2c3801b50a5b1ec6d6509f37e366f7e4 to your computer and use it in GitHub Desktop.
Remove Popup Maker from the wp-admin side menu for non-admins.
<?php // Ignore this first line when copying to your child theme's functions.php file.
add_action( 'admin_init', function () {
if ( ! current_user_can( 'manage_options' ) ) {
remove_menu_page( 'edit.php?post_type=popup' ); // Popup Maker
}
} );
/**
 * You can add the PHP code snippet to your child theme's functions.php file
 * or with third-party plugins such as My Custom Functions and Code Snippets.
 *
 * Learn more:
 * - https://wppopupmaker.com/docs/getting-started-with-custom-code/getting-started-with-custom-js/
 * - https://wppopupmaker.com/docs/getting-started-with-custom-code/getting-started-with-custom-php/
 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment