MCPcopy Index your code
hub / github.com/WPUserManager/wp-optionskit

github.com/WPUserManager/wp-optionskit @1.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1.2 ↗ · + Follow
32 symbols 54 edges 14 files 31 documented · 97%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

wp-optionskit

Packagist Packagist3 Packagist2 PHP from Packagist

A toolkit for WordPress developers to create VueJS powered administration options panels in WordPress plugins and themes.

Installation

composer require wp-user-manager/wp-optionskit

Usage

<?php

$prefix = 'igp';
$panel  = new \TDP\OptionsKit( $prefix );
$panel->set_page_title( __( 'My Plugin Settings' ) );

/**
 * Setup the menu for the options panel.
 *
 * @param array $menu
 *
 * @return array
 */
function igp_setup_menu( $menu ) {
    // These defaults can be customized
    // $menu['parent'] = 'options-general.php';
    // $menu['menu_title'] = 'Settings Panel';
    // $menu['capability'] = 'manage_options';

    $menu['page_title'] = __( 'My Plugin Settings' );
    $menu['menu_title'] = $menu['page_title'];

    return $menu;
}

add_filter( 'igp_menu', 'igp_setup_menu' );

/**
 * Register settings tabs.
 *
 * @param array $tabs
 *
 * @return array
 */
function igp_register_settings_tabs( $tabs ) {
    return array(
        'general' => __( 'General' ),
    );
}

add_filter( 'igp_settings_tabs', 'igp_register_settings_tabs' );

/**
 * Register settings subsections (optional)
 *
 * @param array $subsections
 *
 * @return array
 */
function igp_register_settings_subsections( $subsections ) {
    return $subsections;
}

add_filter( 'igp_registered_settings_sections', 'igp_register_settings_subsections' );

/**
 * Register settings fields for the options panel.
 *
 * @param array $settings
 *
 * @return array
 */
function igp_register_settings( $settings ) {
    $settings = array(
        'general' => array(
            array(
                'id'   => 'api_key',
                'name' => __( 'API Key' ),
                'desc' => __( 'Add your API key to get started' ),
                'type' => 'text',
            ),
            array(
                'id'   => 'results_limit',
                'name' => __( 'Results Limit' ),
                'type' => 'text',
                'std'  => 10,
            ),
            array(
                'id'   => 'start_date',
                'name' => __( 'Start Date' ),
                'type' => 'text',
            ),
        ),
    );

    return $settings;
}

add_filter( 'igp_registered_settings', 'igp_register_settings' );
````

## Development

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

Core symbols most depended-on inside this repo

get_settings_tabs
called by 3
wp-optionskit.php
get_registered_settings
called by 3
wp-optionskit.php
get_registered_settings_sections
called by 2
wp-optionskit.php
hooks
called by 1
wp-optionskit.php
get_rest_url
called by 1
wp-optionskit.php
get_labels
called by 1
wp-optionskit.php
is_options_page
called by 1
wp-optionskit.php
get_default_tab
called by 1
wp-optionskit.php

Shape

Method 30
Class 2

Languages

PHP100%

Modules by API surface

wp-optionskit.php22 symbols
includes/class-wpok-rest-server.php10 symbols

For agents

$ claude mcp add wp-optionskit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact