1. Home
  2. EdminBoost
  3. Developers
  4. Adding a feature

Adding a feature

Rule of thumb

Use defined constants and class constants. Do not hardcode edminboost-smart-admin-productivity-tool or random option names in new code.

Bootstrap constants (edminboost-smart-admin-productivity-tool.php)

EDMINBOOST_VERSION — plugin version string (enqueue version)

EDMINBOOST_PLUGIN_FILE — main plugin file path

EDMINBOOST_PLUGIN_DIR — plugin directory path

EDMINBOOST_PLUGIN_URL — plugin URL

EDMINBOOST_PLUGIN_BASENAME — relative path under wp-content/plugins

EDMINBOOST_PLUGIN_SLUG — edminboost-smart-admin-productivity-tool (canonical slug)

EDMINBOOST_TEXT_DOMAIN — edminboost (must stay aligned with slug policy in releases)

EDMINBOOST_PLUGIN_DOCS_URL — public docs URL

EDMINBOOST_UPGRADE_URL — external pricing URL

Settings constants (EDMINBOOST_Settings)

OPTION_NAME — edminboost_settings

SETTINGS_GROUP — edminboost_settings_group

VERSION_OPTION — edminboost_version

CAPABILITY — manage_options (who can open settings and AJAX)

Admin page slug

EDMINBOOST_Admin::PAGE_SLUG equals EDMINBOOST_PLUGIN_SLUG.

Full admin page query arg:

admin.php?page={PAGE_SLUG}{suffix}

Command Center page suffixes (EDMINBOOST_Command_Center)

Append to PAGE_SLUG:

  • PAGE_PRESETS — -presets (Layout Presets)
  • PAGE_APPEARANCE — -appearance (Theme)
  • PAGE_MAPPER — -mapper (Top Bar)
  • PAGE_MENU_STUDIO — -menu
  • PAGE_PRODUCTIVITY — -productivity
  • PAGE_SECURITY — -security
  • PAGE_PERFORMANCE — -performance
  • PAGE_WHITE_LABEL — -white-label
  • PAGE_BILLING — -billing

Settings sidebar page:

  • PAGE_SLUG . ‘-settings’

Legacy redirects:

  • PAGE_ONBOARDING — -onboarding → Dashboard
  • PAGE_BEHAVIOR — -behavior → Theme

Prefix conventions (10-character edminboost)

PHP classes: EDMINBOOST_{Name}

Functions: edminboost_{action}()

Options: edminboost_{key}

Hooks: edminboost_{name}

CSS classes: edminboost-*

Script/style handles: edminboost-{name}

Localized JS globals: edminboostData (admin screens), edminboostCcBar (live drawer bar)

Menu Studio custom menu slugs: edminboost_ms_{id} via EDMINBOOST_Menu_Studio::get_custom_menu_slug()

AJAX and nonces (common patterns)

Settings save nonce: tied to SETTINGS_GROUP . ‘-options’

Export: edminboost_export_settings

Import: edminboost_import_settings

CC nav: edminboost_cc_nav

Drawer preview: edminboost_cc_drawer_preview

Drawer iframe: action edminboost_cc_drawer_{md5(slug + anchor)}

Asset paths

CSS: admin/css/edminboost-admin.css, edminboost-themes.css, etc.

JS: admin/js/edminboost-admin.js, edminboost-command-center-bar.js

Partials: admin/partials/edminboost-*.php

When building URLs in PHP

admin_url( ‘admin.php?page=’ . EDMINBOOST_Admin::PAGE_SLUG . EDMINBOOST_Command_Center::PAGE_MAPPER );

When checking the current screen

Use EDMINBOOST_Admin::is_plugin_screen() and related helpers instead of parsing $_GET[‘page’] with string literals.

How can we help?