awesome9/admin-page

WordPress page class.

1.0.0 2021-07-10 04:39 UTC

This package is auto-updated.

Last update: 2024-12-10 11:59:19 UTC


README

Awesome9 Latest Stable Version PHP from Packagist Total Downloads License

📃 About Page

This package provides ease adding pages to WordPress backend.

💾 Installation

composer require awesome9/admin-page

🕹 Usage

First, you need to register options for your theme/plugin.

$page = new Awesome9\Admin\Page(
	'awesome9_plugin_options',   // Unique id which is page slug
	esc_html__( 'Awesome Page', 'text-domain' )
	[
		'position'   => 40,
		'parent'     => 'awesome-parent',
		'capability' => 'manage_options',
		'render'     => 'some-view-in-file.php',
		'help'       => [
			'redirections-overview'       => [
				'title' => esc_html__( 'Overview', 'text-domain' ),
				'view'  => 'help-tab-overview.php',
			],
			'redirections-screen-content' => [
				'title' => esc_html__( 'Screen Content', 'text-domain' ),
				'view'  => 'help-tab-screen-content.php',
			],
			'redirections-actions'        => [
				'title' => esc_html__( 'Available Actions', 'text-domain' ),
				'view'  => 'help-tab-actions.php',
			],
			'redirections-bulk'           => [
				'title' => esc_html__( 'Bulk Actions', 'text-domain' ),
				'view'  => 'help-tab-bulk.php',
			],
		],
	]
);

📖 Changelog

See the changelog file