Support » Plugin: OptionTree » Allowing `get_option_tree` on the admin side

  • Is there any specific reason to disallow the use of get_option_tree on the admin side?

    I have a scenario where I’d like to use it: A custom user role has access to the admin area to modify custom data, but not access to any other WP admin section. The admins need to have editable help text for those users and this plugin would be a simple way for me to add it.

    (I understand that normally this kind of user would edit the data on the front end, but the client did not order designs for those pages, so it’s in the WP admin area.)

    For now, I’m allowing it (with no visible side-effects) by adding this to my plugin’s admin_init action hook:

    if ( defined( "OT_PLUGIN_DIR" ) && file_exists( OT_PLUGIN_DIR . '/functions/get-option-tree.php' )  ) {
      require_once( OT_PLUGIN_DIR . '/functions/get-option-tree.php' );

    Of course, I’d rather not have to make this check. 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • within the file:


    Go to line 28, paste in next line this:

    include( OT_PLUGIN_DIR . ‘/functions/get-option-tree.php’ );

    This will work, using own resources the plugin. The function oprtion-tree will now work in the wp-admin as well.

    You can do that, but it can (and probably will) get overwritten in the next OptionTree update, which is why I chose to load it in my plugins admin_init action hook instead.

    Yes, you’re right.

    Plugin Author Derek Herman


    Added function to the admin side in 1.1.8 coming out soon.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Allowing `get_option_tree` on the admin side’ is closed to new replies.