parent ) && $this->parent ) { $priority = intval( $this->position ); } $this->position = 2; $this->add_action( 'admin_menu', 'register_page', $priority ); if( !isset( $_GET['page'] ) || empty( $_GET['page'] ) || ! $this->id === $_GET['page'] ) { return; } if( method_exists( $this, 'save' ) ) { $this->add_action( 'admin_init', 'save' ); } } /** * [register_page description] * @method register_page * @return [type] [description] */ public function register_page() { if( ! $this->parent ) { add_menu_page( $this->page_title, $this->menu_title, $this->capability, $this->id, array( $this, 'display' ), get_template_directory_uri() . '/liquid/assets/img/liquid-menu-logo.svg', $this->position ); } else { add_submenu_page( $this->parent, $this->page_title, $this->menu_title, $this->capability, $this->id, array( $this, 'display' ) ); } } /** * [display description] * @method display * @return [type] [description] */ public function display() { echo 'default'; } }