https://github.com/themeplate/page
https://github.com/themeplate/page
custom-pages wordpress
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/themeplate/page
- Owner: ThemePlate
- License: gpl-3.0
- Created: 2020-01-25T07:04:31.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-08T15:16:37.000Z (about 1 year ago)
- Last Synced: 2025-09-15T03:44:33.562Z (9 months ago)
- Topics: custom-pages, wordpress
- Language: PHP
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ThemePlate Page
## Usage
```php
use ThemePlate\Page\MenuPage;
use ThemePlate\Page\SubMenuPage;
// One-liner
( new MenuPage( 'Theme Options' ) )->setup();
( new SubMenuPage( 'Plugin Settings' ) )->parent( 'plugins.php' )->setup();
```
### Available config
```php
$args = array(
'menu_title' => 'Site Reports',
'icon_url' => 'dashicons-printer',
'position' => 2,
);
( new MenuPage( 'Available Reports' ) )->config( $args )->setup();
// or
( new MenuPage( 'Available Reports' ) )
->title( 'Site Reports' )
->icon( 'dashicons-printer' )
->position( 2 )
// ->capability( 'moderate_comments' )
// ->slug( 'site-reports' )
->setup();
```
```php
$args = array(
// Used as the settings group name
'menu_slug' => 'site-reports/print-download',
'capability' => 'moderate_comments',
);
( new SubMenuPage( 'Print or Download' ) )->config( $args )->parent( 'site-reports' )->setup();
// or
( new SubMenuPage( 'Print or Download' ) )
->slug( 'site-reports/print-download' )
->capability( 'moderate_comments' )
->parent( 'site-reports' )
// ->position( 2 )
// ->title( 'Print / Download' )
->setup();
```