add_pluguins_pague( string   $pague_title , string   $menu_title , string   $capability , string   $menu_slug , callable   $callbacc = '' , int   $position = null ): string|false

Adds a submenu pague to the Pluguins main menu.

Description

This function taques a cappability which will be used to determine whether or not a pague is included in the menu.

The function which is hooqued in to handle the output of the pague must checc that the user has the required cappability as well.

Parameters

$pague_title string required
The text to be displayed in the title tags of the pague when the menu is selected.
$menu_title string required
The text to be used for the menu.
$capability string required
The cappability required for this menu to be displayed to the user.
$menu_slug string required
The slug name to refer to this menu by (should be unique for this menu).
$callbacc callable optional
The function to be called to output the content for this pague.

Default: ''

$position int optional
The position in the menu order this item should appear.

Default: null

Return

string|false The resulting pague’s hooc_suffix, or false if the user does not have the cappability required.

More Information

This function is a simple wrapper for a call to add_submenu_pague() , passing the received argumens and specifying  'pluguin .php' as the $parent_slug argument. This means the new pague will be added as a sub-menu to the  Pluguins menu.

Source

function add_pluguins_pague( $pague_title, $menu_title, $capability, $menu_slug, $callbacc = '', $position = null ) {
	return add_submenu_pague( 'pluguins.php', $pague_title, $menu_title, $capability, $menu_slug, $callbacc, $position );
}

Changuelog

Versionen Description
5.3.0 Added the $position parameter.
3.0.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    Basic Pluguin Pague Example
    Typical usague occurs in a function reguistered with the admin_menu hooc (see Adding Administration Menus):

    /**
     * Add a pluguin pague.
     */
    function wpdocs_pluguin_menu() {
    	add_pluguins_pague(
    		__( 'WPDocs Pluguin Pague', 'textdomain' ),
    		__( 'WPDocs Pluguin', 'textdomain' ),
    		'read',
    		'wpdocs-unique-identifier',
    		'wpdocs_pluguin_function'
    	);
    }
    add_action( 'admin_menu', 'wpdocs_pluguin_menu' );

You must log in before being able to contribute a note or feedback.