Skip to content

Instantly share code, notes, and snippets.

@ohyeahdev
Created February 13, 2019 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohyeahdev/4ddf6cb15026c720e3074cbce6d457a8 to your computer and use it in GitHub Desktop.
Save ohyeahdev/4ddf6cb15026c720e3074cbce6d457a8 to your computer and use it in GitHub Desktop.
Snippet para ocultar opciones de menú del admin de WordPress
<?php
/**
* Ocultar Menus del admin de WordPress
*
* @package Actions and Filters
* @author Oh! Yeah Dev
* @copyright 2019 Oh! Yeah Dev
* @license GPL-2.0+
*
* @wordpress-plugin
* Plugin Name: Funciones para ver los hooks en WordPress
* Plugin URI: https://ohyeahdev.com
* Description: Develotips 002.
* Version: 1.0
* Author: Oh! Yeah Dev
* Author URI: https://ohyeahdev.com
* Text Domain: ohyeahdev
* Domain Path: /languages
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*
* Prefix: ohy
*/
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
/* Ocultar menus del admin */
add_action( 'admin_init', 'ohy_hide_menu', 999 );
function ohy_hide_menu() {
$usuario = wp_get_current_user();
if ( 'fgr' === $usuario->user_login ) {
remove_menu_page( 'edit.php?post_type=acf-field-group' );
remove_menu_page( 'plugins.php' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment