Support » Plugin: OptionTree » [Plugin: OptionTree] Theme Integration

  • Ruven


    Really cool and easy to use plugin!

    I was just wondering, if I can also integrate it into a theme, so the theme users don’t have to deal with plungin installation and data import. I would like to provide out of the box functionality. So as soon as the user activates the theme, he should have the theme option menu with all the options ready to start.

    Is that pollible now or in future versions?

    Thank you.

Viewing 15 replies - 1 through 15 (of 33 total)
  • _rg_



    Plugin Author Derek Herman


    It would take a huge overhaul to make THIS code a class you could just plugin into WordPress. I know some of you think that is ideal, but how would updates be distributed to the community?

    I could look into it but I can’t promise anything. I have a lot of work to do on the OptionTree container site and Envato is launching a few new projects I need to finish soon so making this a class will have to wait till I have a moment of free time, sorry.

    I promise I will look into it though.

    Wow, this is excellent plugin Derek. I’ll add my +1 to this thread.

    I have managed to integrate the plugin into the theme so it doesn’t require activation via the plugin directory, all I need to know now is, is there a page I can insert my options code into in the following form for instance:

            'item_id' => $item_id,
            'item_title' => $item_title,
            'item_desc' => $item_desc,
            'item_type' => $item_type,
            'item_options' => $item_options,
            'item_sort' => $id

    I tried adding something similar to where the Test Input field is inserted in class.admin.php, but it doesn’t seem to work. Is the plugin not capable of this type of customization in it’s current form?

    Plugin Author Derek Herman


    I’ve thought of some ideas for making this more theme developer friendly. I’ll work out my idea and hopefully if time permits have it updated next week.

    It’s not going to be a class but will allow a sort of hidden default array.

    Great job Derek, very usefull plugin !

    GhostPool, did you right a post to explain how integrate Derek’s plugin into the theme ? I’m very interesting.

    Thank you

    … did you write … sorry

    All you need to do is refer to the index.php file that comes with the plugin in functions.php e.g.

    require_once (TEMPLATEPATH . 'option-tree/index.php');

    Then remove the references to the plugin directory from index.php:

    define( 'OT_PLUGIN_DIR', ...
    define( 'OT_PLUGIN_URL', ...

    And add this to functions.php:

    define( 'OT_PLUGIN_DIR', get_template_directory_uri() . '/lib/admin/inc/option-tree');
    define( 'OT_PLUGIN_URL', get_template_directory_uri() . '/lib/admin/inc/option-tree');

    Obviously replacing it with your own directory structure.

    Sorry but i’ve got a problem, i’m not php developper, just a designer 😉

    So i did that :

    I putted the option-tree folder in my theme folder: MyTheme > option-tree

    I commented this two lines in the option-tree index.php

    // define( 'OT_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
    // define( 'OT_PLUGIN_URL', WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) );

    I added this in my functions.php theme

    require_once (TEMPLATEPATH . '/option-tree/index.php');
    define( 'OT_PLUGIN_DIR', get_template_directory_uri() . '/option-tree');
    define( 'OT_PLUGIN_URL', get_template_directory_uri() . '/option-tree');

    The first line seems ok, i think the problem comes from the second and third line of code.

    Result :

    I see the option-tree box in my left admin sidebare but the center of the page is empty (no forms in the center of the admin page) but just this message display : “No direct script access allowed”

    Any idea of my mistake ?

    Make sure you did not remove the version number reference from index.php e.g.

    define( 'OT_VERSION', '1.1.1' );

    My version number reference in index.php is ok and not comment.

    Maybe you might send me your index.php and functions.php to compare with mine.


    Thank you for your help.

    @ghostpool and @vauvarin – did you figure out what was wrong? I have followed the same proceedure and get some warnings referring to class.admin.php

    Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\wamp\www\startup\wp-content\themes\silverpoint\option-tree\classes\class.admin.php on line 372

    I got it to work. I used TEMPLATEPATH to link up the frontend files on the lines where the warnings referred.


    I’m also interested in inserting option code manually. Have anyone already done it?

            'item_id' => $item_id,
            'item_title' => $item_title,
            'item_desc' => $item_desc,
            'item_type' => $item_type,
            'item_options' => $item_options,
            'item_sort' => $id

    Thanks for the solution I was also looking for the same …

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘[Plugin: OptionTree] Theme Integration’ is closed to new replies.