Whitelabel Plugin v.1.2.
Online Documentation

Table of Contents

Free Customer Support

We provide Free Customer Support for all Curly Themes products through our quick and easy ticket application interface. Please limit your inquiries to problems related to the plugin, its setup and features. For any problems concerning third-party plugins you should address the application’s developer.

Note: We can not offer support for custom CSS code customization. You should ask a professional developer for aid if you require help with advanced customization and programming.

Free Ticket Support

Curly Themes offers a free ticket support application for all clients, through a real-time purchase code automatic verification. The dedicated app is fast and easy to use and includes an email notification feature. We will let you know as soon as your inquiry has received an answer. Thanks to our modern design, you can also upload images as an attachment to your support ticket.

Before writing a ticket please get your License Certificate:
Whitelabel

Whitelabel

Before opening a new ticket, please make sure you have read through all our documentation. Also, our Knowledge Base contains helpful answers to questions we often receive from our customers. Following these steps is in the users’ interest, as they will save valuable time. Still, we are always happy to respond to any inquiries you may have related to our theme.

Create Support Ticket Knowledge Base

Theme & Plugin Integration

IMPORTANT: From version 1.2 Whitelabel has been re-written OOP and now it can be used by plugin developers. From version 1.2 you can create multiple options pages in the same theme.

In order to install Whitelabel you need to follow the next steps:

  • Step 1: Unzip the package downloaded from CodeCanyon
  • Step 2: Open the folder named WordPress Files located in your unzipped folder of the download package
  • Step 3: From your unzipped folder copy to clipboard the folder named admin and paste it in your theme or plugin folder (ie. wp-content/themes/twentyeleven/admin/)
  • Step 4: Open up the functions.php file, located in your theme or your plugin file and paste the following lines of code:
/** Define the Options Prefix */
define('THEMEPREFIX', 'white');

/** Include the Whitelabel plugin */
include( get_template_directory() . '/admin/admin-page.php' );

/** Include the $options array */
include( 'admin/options.php' );

/** Create the Options Page */
$options_page = new WhitelabelOptions( $name, $slug, $prefix, $parent, $icon, $role, 
$order, $style, $title, $sidebar, $options, $url, $options );

IMPORTANT: It is important to understand that this plugin may be used by other developers and it may end up to be used multiple times in the same WordPress installation, which is perfectly fine, just bear in mind that your prefix constant needs to be unique.
THEMEPREFIX – Please choose a unique PREFIX constant, such as THEMEPREFIX, PLUGINPREFIX, MYPREFIX, ABCPREFIX; try to make sure you choose a constant name that will more likely be unique. Please set an unique prefix for your options. Your options will be saved in the options table of WordPress so it’s important that they have a unique name. (ie. if your theme is called Equestrian use eque as THEMEPREFIX)
$name – Please set your Theme Options Page name & title. This is how your page will appear under the Appearance menu. (ie. Theme Options, Site Options, Main Options). Default: “Whitelabel Options”
$slug – Please set you options page menu slug. Default: “whitelabel-options”
$prefix – Please set your options page prefix. It should be same as the THEMEPREFIX constant. Default: “white”
$parent – Please set the parent of your page. Default: null. Please see http://codex.wordpress.org/Function_Reference/add_submenu_page for more details
$icon – Please set an icon for your page. The icon is not available for submenu pages. Default: null. Please see http://melchoyce.github.io/dashicons/ for more details
$role – Please set your Theme Options Page user roles. This setting will set the permissions for this page based on the user level. To learn more about WordPress User Roles please visit this page: http://codex.wordpress.org/Roles_and_Capabilities and see the Capability vs. Role Table for user roles. (ie. if you want all users to access the Theme Options Page set your $role to ‘read’)
$order – Please set the order of your page. Default: null
$style – Please choose if you want to use the standard WordPress typography or not. If true, the typography will be slightly enhanced. Default: boolean true
$title – Please choose if you want your options page to have a title. Default: boolean false
$sidebar – If you wish to use the Whitelabel Sidebar Generator for your theme just set this to boolean true. For more details see Chapter Sidebars
$options – Please provide an array with options which will be used to generate the options page
$url – Please enter the url of the theme or of the plugin. It is recommended that you use the get_template_directory_uri() function for themes and the plugins_url() function for plugins. For themes this parameter can be empty, but for plugins is mandatory
$folder – By default the plugin is located in the admin folder, but if you wish change it you will have to set this parameter with the new path.
Step 5: That’s it! The Whitelabel is now added to your WordPress Theme or Plugin.

Options & Attributes

Before you start adding your options it’s important that you read the following details about each option. With Whitelabel you can create an unlimited number of option pages.

Adding options is quite simple, all you have to do is open the options.php file located in your admin folder and add your options as part of the options array.

Before adding your options it’s important to understand that each option needs to be prefixed with your custom THEMEPREFIX.

List of available options with their available attributes

  1. Sections (Admin Only) Attributes: name, type
    $options[] = array( "name" => "All Options",
    "type" => "section");
  2. Titles (Admin Only) Attributes: name, type, class, desc
    $options[] = array( "name" => "Title Field",
    "type" => "title", "desc" => "Sed haec quis possit intrepidus aestimare tellus");
  3. Info Boxes (Admin Only) Attributes: name, type, class, desc, std
    $options[] = array( “name” => “Info Box Field”,
    “type” => “info”,
    “std” => “Me non paenitet nullum festiviorem excogitasse ad hoc”);
  4. Dividers (Admin Only) Attributes: type
    $options[] = array(“type” => “divider”);
  5. HTML Fields (Admin Only) Attributes: name, type, class, desc, std
    $options[] = array( “name” => “HTML Field”,
    “type” => “html”,
    “std” => “Me non paenitet nullum festiviorem excogitasse ad hoc.”);
  6. Text Fields Attributes: id, name, type, class, desc, std, placeholder
    $options[] = array( “name” => “Text Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_text”,
    “class” => “medium first”,
    “placeholder” => “Placeholder”,
    “std” => null,
    “type” => “text”);
  7. Textarea Fields Attributes: id, name, type, class, desc, std, placeholder
    $options[] = array( “name” => “Textarea Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_textarea”,
    “class” => “medium first”,
    “placeholder” => “Textarea Field”,
    “std” => null,
    “type” => “textarea”);
  8. Editor Fields (WordPress Editor) Attributes: id, name, type, class, desc, std, editor_settings
    $options[] = array( “name” => “WordPress Editor Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_editor”,
    “type” => “editor”);
  9. Checkboxes Attributes: id, name, type, class, desc, std
    $options[] = array( “name” => “Checkbox Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_checkbox”,
    “class” => “medium first”,
    “std” => “true”,
    “type” => “checkbox”);
  10. Checkbox Lists Attributes: id, name, type, class, desc, std, options
    $options[] = array( “name” => “Checkboxes Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_checkboxes3″,
    “class” => “medium first”,
    “std” => array(“true”, null, “true”),
    “type” => “checkboxes”,
    “options” => array(
    0 => “First Option”,
    1 => “Second Option”,
    2 => “Third Option”
    ));
  11. Radio Buttons Attributes: id, name, type, class, desc, std, options
    $options[] = array( “name” => “Radio Boxes Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_radios2″,
    “class” => “medium first”,
    “std” => 2,
    “type” => “radio”,
    “options” => array(
    0 => “First Option”,
    1 => “Second Option”,
    2 => “Third Option”
    ));
  12. Classic Select Boxes Attributes: id, name, type, class, desc, std, options
    $options[] = array( “name” => “Classic Select Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_select”,
    “class” => “medium first”,
    “std” => 2,
    “type” => “select”,
    “options” => array(
    0 => “First Option”,
    1 => “Second Option”,
    2 => “Third Option”
    ));
  13. Select Boxes with Search Attributes: id, name, type, class, desc, std, options
    $options[] = array( “name” => “Special Select Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_select_search”,
    “class” => “medium first”,
    “std” => 1,
    “type” => “select_search”,
    “options” => array(
    0 => “First Option”,
    1 => “Second Option”,
    2 => “Third Option”
    ));
  14. Multi-Select Boxes Attributes: id, name, type, class, desc, std, options
    $options[] = array( “name” => “Multi Select Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_select_multi”,
    “class” => “medium first”,
    “std” => array(0, 2),
    “type” => “select_multiple”,
    “options” => array(
    0 => “First Option”,
    1 => “Second Option”,
    2 => “Third Option”
    ));
  15. Switches Attributes: id, name, type, class, desc, std
    $options[] = array( “name” => “Use Responsive Layout”,
    “desc” => “Non equidem invideo, miror magis posuere velit aliquet.”,
    “id” => THEMEPREFIX.”_responsive”,
    “class” => “medium last”,
    “std” => “true”,
    “type” => “switch”);
  16. Upload Field (WordPress Upload) Attributes: id, name, type, class, desc, std
    $options[] = array( “name” => “Upload Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_upload”,
    “class” => “medium first”,
    “std” => null,
    “type” => “upload”);
  17. Mini Upload Field (WordPress Upload) Attributes: id, name, type, class, desc, std :
    $options[] = array( “name” => “Mini Upload Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_upload_min”,
    “class” => “medium first”,
    “std” => null,
    “type” => “upload_min”);
  18. Number Fields (Sliders) Attributes: id, name, type, class, desc, std, min, max, prefix, suffix, increment
    $options[] = array( “name” => “Number Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_slider”,
    “class” => “medium first”,
    “std” => 20,
    “min” => 0,
    “max” => 100,
    “prefix” => null,
    “suffix” => “%”,
    “increment” => 0.1,
    “type” => “number”);
  19. Button Groups Attributes: id, name, type, class, desc, std, options
    $options[] = array( “name” => “Buttons Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_buttons”,
    “class” => “medium first”,
    “std” => 2,
    “type” => “buttons”,
    “options” => array(
    0 => “First Option”,
    1 => “Second Option”,
    2 => “Third Option”
    ));
  20. Image Groups Attributes: id, name, type, class, desc, std, options
    $options[] = array( “name” => “Images Field”,
    “desc” => “Sed haec quis possit intrepidus aestimare tellus”,
    “id” => THEMEPREFIX.”_images”,
    “class” => “medium first”,
    “std” => 2,
    “type” => “images”,
    “options” => array(
    0 => $imgurl.’img1.png’,
    1 => $imgurl.’img2.png’,
    2 => $imgurl.’img3.png’
    ));
    $imgurl is a variable that holds the file path
  21. Classic Typography Attributes: id, name, type, class, desc, std, options, min, max, suffix
    $options[] = array( "name" => "Google Font Field" "desc" => "Sed haec quis possit intrepidus aestimare tellus", "id" => THEMEPREFIX."_font", "class" => "medium first", "std" => array("Droid Sans", 20, 0, 0), "min" => 10, "max" => 24, "suffix" => "px", "type" => "google_font", "options" => $google_fonts);

    $google_font is an array that holds the font list

  22. Google Typography Attributes: id, name, type, class, desc, std, options, min, max, suffix
$options[] = array( "name" => "Classic Font Field",
 "desc" => "Sed haec quis possit intrepidus aestimare tellus",
 "id" => THEMEPREFIX."_font2",
 "class" => "medium first",
 "std" => array("Arial, sans-serif", 20, 0, 0),
 "min" => 10,
 "max" => 24,
 "suffix" => "px",
 "type" => "font",
 "options" => $font_list);

$font_list is an array that holds the font list

Color Pickers (WordPress Color Picker) Attributes: id, name, type, class, desc, std

$options[] = array( “name” => “Color Field”,
“desc” => “Sed haec quis possit intrepidus aestimare tellus”,
“id” => THEMEPREFIX.”_color”,
“class” => “medium first”,
“std” => “#CC0000”,
“type” => “color”);
iFrames (Admin Only) Attributes: id, name, type, class, desc, source, height
$options[] = array( “name” => “iFrame Field”,
“type” => “iframe”,
“source” => “http://www.envato.com”,
“height” => 500,
“desc” => “At nos hinc posthac, sitientis piros Afros”;
Backup & Restore Field Attributes: name, type, class, desc
$options[] = array( “name” => “Backup Field”,
“desc” => “Sed haec quis possit intrepidus aestimare tellus”,
“id” => THEMEPREFIX.”_textarea”,
“class” => “medium first”,
“type” => “backup”);
Reset Field Attributes: name, type, class, desc
$options[] = array( “name” => “Reset Theme Options”,
“desc” => “Tityre, tu patulae recubans sub tegmine fagi dolor”,
“class” => “medium first”,
“type” => “reset”);
Export Field Attributes: name, type, class, desc
$options[] = array( “name” => “Export Field”,
“desc” => “Sed haec quis possit intrepidus aestimare tellus”,
“class” => “medium first”,
“type” => “export”);
Import Field Attributes: name, type, class, desc, placeholder
$options[] = array( “name” => “Import Field”,
“desc” => “Tityre, tu patulae recubans sub tegmine fagi dolor.”,
“class” => “medium last”,
“placeholder” => “Paste your export code here”,
“type” => “import”);

(Admin Only) – This options are only available in the admin and they are used for constructing the Theme Options Page.

Attributes

  • name – Name of the option field.
  • type – Type of the option field. Available types are: section, title, info, divider, html, text, textarea, editor, checkbox, checkboxes, radio, select, select_multiple, select_search, switch, number, buttons, images, google_font, font, color, iframe, backup, reset. This is a mandatory field on all fields.
  • class – CSS class of the option field. Default values are: tiny (25% width), short (33.33% width), medium (50% width), first (if it’s the first element within a set), last (if it’s the last element within a set). No class is required if you want the element to be 100%.If only one element needs a size class, and nothing else after it then first needs to be applied. Fields can be grouped on rows of one, two, three and four elements. Each time specifying the first and last is mandatory except the case where is only one 100% width element.
  • desc – Option field description. Place below the field in small gray text
  • std – Standard (default) option field value. Depending on the field type the std field can be a string, an array or NULL.
  • id – Unique options field id. Must start with the THEMEPREFIX constant. (ie: THEMEPREFIX.’_website_name’)
    This is a mandatory field on all fields if specified above
  • placeholder – Options field placeholder. Only for text and textarea fields
  • editor_settings – Options field editor settings. Array of settings for the WordPress Editor initialization.
    More details here: https://codex.wordpress.org/Function_Reference/wp_editor
  • options – Options field options. Array of options. Only for checkboxes, radio buttons, select boxes, buttons & images (ie. array(“Choice 1”, “Choice 2”, “Choice 3”))
  • min – Options field minimum. This sets the minimum value of the slider. For number it will be the minimum number, while for fonts it will be the minimum font size.
  • max – Options field maximum. This sets the maximum value of the slider. For number it will be the maximum number, while for fonts it will be the maximum font size.
  • prefix – Prefix for the number. The slider value will be prefixed with this attribute’s value. Only applicable for the number and fonts fields
  • suffix – Suffix for the number. The slider value will be suffixed with this attribute’s value. Only applicable for the number and fonts fields
  • increment – Increment value. This value will act as incremental steps for the slider. Only applicable for the number and fonts fields.(ie. 1, 0.1, 5, 0.5)
  • source – iFrame source. Only applicable to iframes
  • height – Set the height of the iframe. Only applicable to iframes

Outputting Values

For outputting options please review the sample-page.php file located in the WordPress Files folder.

Options are outputted using the get_option() WordPress function. For more details about this, you can visit this link: http://codex.wordpress.org/Function_Reference/get_option

Storing & Displaying Options

// Storing an option
$name = get_option(THEMEPREFIX."_name");

// Displaying the option
echo get_option(THEMEPREFIX."_name");

Sample Code

$name = get_option(THEMEPREFIX."_name");

Special Field Output

  • Image Field:
    get_option(THEMEPREFIX."_image");
  • Image Field ID:
    get_option(THEMEPREFIX."_image_id");

    After your original field id just add _id to retrieve the image id not the file path.

  • Typography:
  • get_option(THEMEPREFIX."_font");

    Returns the Family

  • Typography Size:
  • get_option(THEMEPREFIX."_font_size");

    After your original field id just add _size to retrieve the font size

  • Typography Style:
  • get_option(THEMEPREFIX."_font_style");

    After your original field id just add _style to retrieve the font style

  • Typography Variant:
  • get_option(THEMEPREFIX."_font_variant");

    After your original field id just add _variant to retrieve the font variant

Release Notes:

Whitelabel Plugin V.1.2. (March 10, 2014)