Admin_Menu::register_options_menu_page()

Create Plugin options menu


Source

File: src/core/admin/class-admin-menu.php

	public function register_options_menu_page() {
		$parent_slug              = 'edit.php?post_type=uo-recipe';
		$this->settings_page_slug = $parent_slug;
		$function                 = array( $this, 'logs_options_menu_page_output' );
		add_submenu_page( null, esc_attr__( 'Recipe activity details', 'uncanny-automator' ), esc_attr__( 'Recipe activity details', 'uncanny-automator' ), 'manage_options', 'uncanny-automator-recipe-activity-details', $function );
		add_submenu_page( $parent_slug, esc_attr__( 'Recipe log', 'uncanny-automator' ), esc_attr__( 'Recipe log', 'uncanny-automator' ), 'manage_options', 'uncanny-automator-recipe-log', $function );
		add_submenu_page( $parent_slug, esc_attr__( 'Trigger log', 'uncanny-automator' ), esc_attr__( 'Trigger log', 'uncanny-automator' ), 'manage_options', 'uncanny-automator-trigger-log', $function );
		add_submenu_page( $parent_slug, esc_attr__( 'Action log', 'uncanny-automator' ), esc_attr__( 'Action log', 'uncanny-automator' ), 'manage_options', 'uncanny-automator-action-log', $function );
		add_submenu_page(
			null,
			esc_attr__( 'Debug logs', 'uncanny-automator' ),
			esc_attr__( 'Debug logs', 'uncanny-automator' ),
			'manage_options',
			'uncanny-automator-debug-log',
			array(
				$this,
				'debug_logs_options_menu_page_output',
			)
		);

		/* translators: 1. Trademarked term */
		$page_title               = sprintf( esc_attr__( '%1$s settings', 'uncanny-automator' ), 'Uncanny Automator' );
		$capability               = 'manage_options';
		$menu_title               = esc_attr__( 'Settings', 'uncanny-automator' );
		$menu_slug                = 'uncanny-automator-settings';
		$this->settings_page_slug = $menu_slug;
		$function                 = array( $this, 'options_menu_settings_page_output' );

		add_submenu_page( 'edit.php?post_type=uo-recipe', $page_title, $menu_title, $capability, $menu_slug, $function );

		$function = array( $this, 'tools_menu_page_output' );
		add_submenu_page( $parent_slug, esc_attr__( 'Tools', 'uncanny-automator' ), esc_attr__( 'Tools', 'uncanny-automator' ), 'manage_options', 'uncanny-automator-tools', $function );
		add_submenu_page(
			null,
			esc_attr__( 'Database tools', 'uncanny-automator' ),
			esc_attr__( 'Database tools', 'uncanny-automator' ),
			'manage_options',
			'uncanny-automator-database-tools',
			array(
				$this,
				'database_tools_menu_page_output',
			)
		);
	}