awesome9/admin-page

WordPress page class.

1.0.0 2021-07-10 04:39 UTC

This package is auto-updated.

Last update: 2024-05-10 10:48:02 UTC


README

Awesome9 Latest Stable Version PHP from Packagist Total Downloads License

68747470733a2f2f696d672e69636f6e73382e636f6d2f6e6f6c616e2f3235362f706167652e706e67

📃 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