Download the PHP package acrossai-co/main-menu without Composer

On this page you can find all versions of the php package acrossai-co/main-menu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package main-menu

AcrossAI Main Menu

A reusable Composer package that registers the shared AcrossAI top-level admin menu and its standard submenus inside WP Admin:

Designed to be installed in multiple plugins side-by-side: automattic/jetpack-autoloader ensures only the highest-version copy boots, so the menu is registered exactly once regardless of how many plugins ship the package.

Requirements

Installation

Load the autoloader in your plugin (jetpack-autoloader generates vendor/autoload_packages.php):

Quick start (consumer plugin)

In your plugin's main file:

That's it. The first plugin (by jetpack-autoloader version resolution) to boot registers, in order under the AcrossAI parent menu:

If 3 plugins all ship this package, you still get one menu and one of each page. Every other copy becomes a no-op via jetpack-autoloader's version resolution.

The Settings page renders a standard <form action="options.php"> with settings_fields(), do_settings_sections(), and submit_button(). Feature plugins (Abilities, MCP, Model, etc.) register their own submenu pages against the acrossai parent slug from their own codebases — the main-menu package no longer pre-registers navigation slots for them.

Known limitations

Adding settings from your plugin

The shared identifier is acrossai-settings — it is both the page slug (for add_settings_section / add_settings_field) and the option_group (for register_setting / settings_fields). Use it as the target everywhere.

That's the entire extension. No JS, no enqueue, no PHP routing — just standard WP hooks. The Settings page will display Plugin A's section automatically.

Tabs

The Settings page has two rendering modes:

Registering a tab

Hook the acrossai_settings_tabs filter and append a tab entry:

Tab entry shape:

Key Required Type Default Notes
slug yes string — Lowercase [a-z0-9_-] (passed through sanitize_key). Used in the ?tab= URL and the per-tab page slug.
label yes string — Already-translated label. Rendered with esc_html.
priority no int 10 Lower = earlier. Ties broken by registration order.
capability no string 'manage_options' Per-tab capability gate. Tabs the user can't satisfy are hidden.

Duplicate slugs: first registration wins. With WP_DEBUG on, subsequent duplicates trigger _doing_it_wrong().

Adding sections/fields to a tab

Get the shared renderer and call its tab_page_slug( 'your-tab-slug' ) instance method to obtain the $page argument:

Notes:

Migrating from 0.0.12 (breaking change)

0.0.13 fixes a cross-tab option-clobber bug by making each tab's form use its own tab-scoped option_page / option_group. If your consumer plugin registered settings against the shared 'acrossai-settings' in tabbed mode, its Save will silently no-op (WP's options.php handler rejects the write because the option is not in the tab-scoped whitelist).

One-line migration per register_setting() call:

No other code changes are required. add_settings_section() / add_settings_field() were already using $page = tab_page_slug(...) — those stay the same.

Reusing the tabbed pattern on another page

The Settings page is one instance of a generic pattern. To add a second tabbed admin page (e.g. a "Tools" page) without re-implementing tab rendering, subclass TabbedPageRenderer and pin two things — the WP page slug and a short key that becomes the tabs filter name:

Third-party plugins register tabs on the new page by hooking acrossai_tools_tabs — same entry shape (slug, label, priority, capability) as acrossai_settings_tabs. They register sections against $renderer->tab_page_slug( 'my-tab' ) exactly as with the Settings page.

The filter name is always "acrossai_{$key}_tabs", so each page gets its own isolated tab list. Rendering, capability gating, active-tab detection, and the per-tab form + Save button are all handled by TabbedPageRenderer — subclasses add no rendering code.

Using the tabs base without a Settings page

The tab plumbing (filter, list, active tab, nav rendering) lives in \AcrossAI_Main_Menu\Tabs. TabbedPageRenderer extends Tabs and layers the Settings-API form + Save button on top. If you want the tab bar but not the Settings-API form — a custom admin screen, a meta box, a dashboard widget, a Tools submenu that renders its own body — extend Tabs directly:

The default tab-URL builder is add_query_arg( 'tab', $slug ) against the current request URL, so tab links stay on whatever screen you're rendering. Two extension points cover non-standard contexts:

For non-URL active-tab sources (block attribute, POST body, session), override protected function get_requested_slug(): string to read from your source instead of $_GET['tab'].

Notices

Any consumer plugin can push admin-notice records into a shared collection with the acrossai_notices filter. Those records surface in two places:

The Notices submenu is not registered when zero notices exist; the summary is not printed on the Notices page itself, when the count is zero, or for users without manage_options.

Registering a notice

The hook that adds the filter callback must fire before admin_menu (priority 25) — init, admin_init, or module bootstrap all work. Registering on admin_notices itself is too late: the notice list is memoized on first read.

Behaviour rules

Reading the notice list

For a consumer that wants to inspect the current collection (for a health check, dashboard widget, etc.):

SettingsPage::get_notices() returns null if the main-menu package has not booted yet in this request — safe to null-guard as shown.

How the page composes across plugins

do_settings_sections( 'acrossai-settings' ) iterates every section registered against that page slug, in registration order. So:

All registered options share one Save button. A single POST to options.php saves every option whitelisted via register_setting( 'acrossai-settings', ... ) regardless of which plugin registered it.

Controlling section order

WP renders sections in the order they're registered. If you need deterministic ordering, hook your admin_init callback with an explicit priority:

Public PHP API

Symbol Purpose
\AcrossAI_Main_Menu\SettingsPage Entrypoint. Construct once per request: new SettingsPage();. Safe to construct from every consumer plugin — jetpack-autoloader picks one copy to boot.
\AcrossAI_Main_Menu\SettingsPage::PARENT_SLUG 'acrossai' — the parent menu slug.
\AcrossAI_Main_Menu\SettingsPage::SETTINGS_SLUG 'acrossai-settings' — the Settings submenu slug, page slug, and option_group.
\AcrossAI_Main_Menu\SettingsPage::NOTICES_SLUG 'acrossai-notices' — the Notices submenu / page slug.
\AcrossAI_Main_Menu\SettingsPage::get_settings_renderer() Returns the shared SettingsPageRenderer instance (or null if the main-menu package has not booted yet in this request). Use it to call ->tab_page_slug( 'your-tab' ).
\AcrossAI_Main_Menu\SettingsPage::get_notices() Returns the shared Notices registry (or null if the main-menu package has not booted yet in this request). Use it to inspect the current notice list.
\AcrossAI_Main_Menu\Notices Notice registry. all() returns the normalized list, count()/has_notices() are helpers, fingerprint() is the sha1 of sorted ids used to invalidate the summary dismissal. See the Notices section above for the filter shape.
\AcrossAI_Main_Menu\Tabs Abstract base for tab bars — filter dispatch (acrossai_{key}_tabs), normalization, capability gating, active-tab resolution, and a render_tab_nav() helper. Extend this directly for any UI that needs a tab bar without the Settings-API form/Save flow (custom admin screens, meta boxes, dashboard widgets, Tools submenus).
\AcrossAI_Main_Menu\TabbedPageRenderer Abstract base for tabbed WP admin pages. Extends Tabs. Subclass and implement get_page_slug() + get_tabs_key() to add a second tabbed page — the filter, rendering, capability gating, and per-tab form/Save button are all handled by the base class.
\AcrossAI_Main_Menu\SettingsPageRenderer Concrete subclass of TabbedPageRenderer used by the Settings page. Exposes tab_page_slug( string $tab_slug ) returning e.g. 'acrossai-settings-providers'.

Notes for multi-plugin installs


All versions of main-menu with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
automattic/jetpack-autoloader Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package acrossai-co/main-menu contains the following files

Loading the files please wait ...