iabdelhay/wp-admin-toolkit-pro

A foundational package for WordPress to manage settings and forms.

dev-main 2024-08-16 23:36 UTC

This package is auto-updated.

Last update: 2024-11-17 00:21:55 UTC


README

A foundational package for WordPress to manage settings and forms.

Installation

Using Composer

  1. Add the package to your Composer project:

    composer require iabdelhay/wp-admin-toolkit-pro
  2. Include the autoloader in your WordPress plugin setup:

    require_once __DIR__ . '/vendor/autoload.php';
  3. Initialize the plugin:

    $plugin = new WPAdminToolkitPro\Bootstrap();
    $plugin->run();

Usage

Adding Settings

To add custom settings, use the SettingsManager class:

add_action('wp_atk_pro_loaded', function() {
    $settingsManager = new WPAdminToolkitPro\Settings\SettingsManager();
    $settingsManager->registerSection('wp_atk_pro_settings', 'custom_section', 'My Custom Settings');
    $settingsManager->addSettingField('wp_atk_pro_settings', 'custom_section', 'custom_setting', 'My Custom Setting');
});