PHP Class Inpsyde\MultilingualPress\Common\Admin\SettingsPage

Since: 3.0.0
Show file Open project: inpsyde/multilingual-press Class Usage Examples

Public Methods

Method Description
__construct ( integer $admin, string $title, string $menu_title, string $capability, string $slug, Inpsyde\MultilingualPress\Common\Admin\SettingsPageView $view, string $icon = '', integer | null $position = null ) Constructor. Sets up the properties.
hookname ( ) : string Returns the hookname.
register ( ) : boolean Registers the settings page.
url ( ) : string Returns the full URL.
with_parent ( integer $admin, string $parent, string $title, string $menu_title, string $capability, string $slug, Inpsyde\MultilingualPress\Common\Admin\SettingsPageView $view ) : static Returns a new settings page object, instantiated according to the given arguments.

Private Methods

Method Description
get_action ( ) : string. Returns the action for registering the page.
get_callback ( ) : callable Returns the callback for adding the page to the admin menu.
get_callback_args ( ) : array Returns the callback args for adding the page to the admin menu.

Method Details

__construct() public method

Constructor. Sets up the properties.
Since: 3.0.0
public __construct ( integer $admin, string $title, string $menu_title, string $capability, string $slug, Inpsyde\MultilingualPress\Common\Admin\SettingsPageView $view, string $icon = '', integer | null $position = null )
$admin integer Admin type. Use the class constants.
$title string Title on the page itself.
$menu_title string Title in the admin menu.
$capability string Capability required to view the settings page.
$slug string Page slug used in the URL.
$view Inpsyde\MultilingualPress\Common\Admin\SettingsPageView View object.
$icon string Optinoal. Icon URL. Defaults to empty string.
$position integer | null Optional. Position in the admin menu. Defaults to null.

hookname() public method

Returns the hookname.
Since: 3.0.0
public hookname ( ) : string
return string The hookname.

register() public method

Registers the settings page.
Since: 3.0.0
public register ( ) : boolean
return boolean Whether or not the settings page was registered successfully.

url() public method

Returns the full URL.
Since: 3.0.0
public url ( ) : string
return string URL.

with_parent() public static method

Returns a new settings page object, instantiated according to the given arguments.
Since: 3.0.0
public static with_parent ( integer $admin, string $parent, string $title, string $menu_title, string $capability, string $slug, Inpsyde\MultilingualPress\Common\Admin\SettingsPageView $view ) : static
$admin integer Admin type. Use the class constants.
$parent string Parent page. Use the available class constants.
$title string Title on the page itself.
$menu_title string Title in the admin menu.
$capability string Capability required to view the settings page.
$slug string Page slug used in the URL.
$view Inpsyde\MultilingualPress\Common\Admin\SettingsPageView View object.
return static Settings page object.