Skip to content

Latest commit

 

History

History
81 lines (62 loc) · 4.28 KB

File metadata and controls

81 lines (62 loc) · 4.28 KB

Dilaz Panel Options Sample

This helps you to integrate Dilaz Panel Plugin into your WordPress theme/plugin development.

How to use

  1. Download and install Dilaz Panel plugin.

  2. Download Dilaz Panel Options.

  3. Add Dilaz-Panel-Options to the root directory of your theme or plugin.
    i) For example:

    wp-content/themes/theme-name/Dilaz-Panel-Options

    OR

    wp-content/plugins/plugin-name/Dilaz-Panel-Options

    ii) You can optionally rename Dilaz-Panel-Options folder.

  4. Add the code provided below in your themes functions.php file or in your plugin's main/index file.

/**
 * Admin Panel Options
 */
require_once 'Dilaz-Panel-Options/admin.php';
  1. Open Dilaz-Panel-Options folder and rename config-sample.php to config.php.
  2. Open Dilaz-Panel-Options/config.php and edit the parameters as you want. Simple guidelines are provided beside each parameter setting.
  3. Open Dilaz-Panel-Options/options folder and rename options-sample.php to options.php.
  4. Open Dilaz-Panel-Options/options/options.php and add your admin options.

NOTE:

  1. Dilaz-Panel-Options/custom-options-sample.php contains examples showing how to use actions hooks to add custom admin options to any Dilaz Panel implementation.
  2. Dilaz-Panel-Options/default-options.php contains default options as examples for all possible admin fields.
  3. Dilaz-Panel-Options/import-export.php contains import/export option settings.

config.php parameters

Parameter Type Default Since (Dilaz Panel) Details
option_name string dilaz_options v2.3 Used to save settings. Must be unique.
option_prefix string dilaz_panel v2.0 Not used to save settings. Must be unique.
use_type string theme v2.0 Where the panel is used. Enter theme if used within a theme OR plugin if used within a plugin
default_options boolean true v2.0 Whether to load default options.
custom_options boolean true v2.0 Whether to load custom options.
page_slug string dilaz_panel v2.0 Must be unique.
page_title string Dilaz Panel v2.0 The text to be displayed in the title tags of the page when the menu is selected.
menu_title string Dilaz Panel v2.0 The text to be used for the menu.
options_view_cap array array('manage_options') v2.7.8 The capabilities required for this menu to be displayed to the user.
options_save_cap array array('manage_options') v2.7.8 The capabilities required for the user to save the options for the panel.
menu_icon string null v2.0 Dashicon menu icon.
menu_position int null v2.3 Position in menu order. Works with top-level menu only.
parent_slug string null v2.3 The slug name for the parent menu (or the file name of a standard WordPress admin page).
admin_bar_menu boolean true v2.0 'true' to show panel in admin bar menu.
import_export boolean true v2.0 'true' to enable import/export field.
log_title string Changelog v2.0 Changlelog title.
log_url string # v2.0 Changlelog url. Leave empty to disable.
doc_title string Documentation v2.0 Documentation title.
doc_url string # v2.0 Documentation url. Leave empty to disable.
support_title string Support v2.0 Support title.
support_url string # v2.0 Support url. Leave empty to disable.
options_cap string manage_options v2.0 Deprecated since v2.7.8.

Download

To get a local working copy of the development repository, do:

git clone https://github.com/Rodgath/Dilaz-Panel-Options.git

Alternatively, you can download the latest development version as a tarball as follows:

wget --content-disposition https://github.com/Rodgath/Dilaz-Panel-Options/tarball/master

OR

curl -LJO https://github.com/Rodgath/Dilaz-Panel-Options/tarball/master