0

When option tree is installed the page "theme options" show under appearance. I want to bring it to top level menu item. i did a deep search and so far I found is:

ot_theme_options_parent_slug

filter to change the parent slug that currently defaults to themes.php.

But I dont know how to do this. Any instruction would be nice.

1

Add this to your functions.php file -

add_filter('ot_theme_options_parent_slug', '__return_false');

Basically it's a filter (ot_theme_options_parent_slug) added by the plugin author and the usage is simple like I provided here. You may consider looking at this page for all available filters for "Option-Tree" plugin - https://github.com/valendesigns/option-tree/blob/master/includes/ot-functions-admin.php By adding this filter, you can pass any function and adjust the UI according to you. Like add_filter('filter_name', 'your_function_name');

Then define the function and do what you like to do - function(your_function_name){//do whatever you like to do}

Btw, (ot_theme_options_parent_slug) this returns default slug of themes.php So by returning is false, it will go to main menu system of wordpress. You may also adjust the position of it by adding additional filter available.

| improve this answer | |
  • Please add an explanation to your answer: why could that solve the problem? – fuxia Jan 11 '15 at 12:09
  • Please edit your answer. Comment content is ignored by our site search. – fuxia Jan 12 '15 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.