src/Page/Page.php
public function build()
    {
        if (is_null($this->getParent())) {
            // Add a top menu page.
            add_menu_page(
                $this->getTitle(),
                $this->getMenu(),
                $this->getCapability(),
                $this->getSlug(),
                [$this, 'render'],
                $this->getIcon(),
                $this->getPosition()
            );
        } else {
            // Add a submenu page.
            add_submenu_page(
                $this->getParent(),
                $this->getTitle(),
                $this->getMenu(),
                $this->getCapability(),
                $this->getSlug(),
                [$this, 'render']
            );
        }
    }
public function build()
    {
        if (is_null($this->getParent())) {
            // Add a top menu page.
            add_menu_page(
                $this->getTitle(),
                $this->getMenu(),
                $this->getCapability(),
                $this->getSlug(),
                [$this, 'render'],
                $this->getIcon(),
                $this->getPosition()
            );
        } else {
            // Add a submenu page.
            add_submenu_page(
                $this->getParent(),
                $this->getTitle(),
                $this->getMenu(),
                $this->getCapability(),
                $this->getSlug(),
                [$this, 'render']
            );
        }
    }
public function build ( ) { if ( is_null ( $ this -> getParent ( ) ) ) { // Add a top menu page. add_menu_page ( $ this -> getTitle ( ) , $ this -> getMenu ( ) , $ this -> getCapability ( ) , $ this -> getSlug ( ) , [ $ this , 'render' ] , $ this -> getIcon ( ) , $ this -> getPosition ( ) ) ; } else { // Add a submenu page. add_submenu_page ( $ this -> getParent ( ) , $ this -> getTitle ( ) , $ this -> getMenu ( ) , $ this -> getCapability ( ) , $ this -> getSlug ( ) , [ $ this , 'render' ] ) ; } }
Build the WordPress pages.
Build the WordPress pages .