Skip to content

Commit

Permalink
Add option to specify the menu item position
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Sep 18, 2023
1 parent f2d5a56 commit 7cd9693
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Admin/AbstractOptionsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public function add_admin_page(): void {
$this->get_menu_title(),
$this->get_capability(),
$this->get_menu_slug(),
[ $this, 'render' ]
[ $this, 'render' ],
$this->get_position()
);
}

Expand Down Expand Up @@ -134,6 +135,15 @@ abstract protected function get_parent_slug(): string;
*/
abstract protected function get_tabs(): void;

/**
* The position in the menu order this item should appear.
*
* @return int|null
*/
protected function get_position(): ?int {
return null;
}

/**
* Enqueue admin area scripts and styles.
*
Expand Down

0 comments on commit 7cd9693

Please sign in to comment.