No docs on how to include in plugin
Yes, there is http://docs.reduxframework.com/redux-framework/advanced/embed/
But this does nothing. When I do all this, nothing appears. No sample options appear anywhere. I also need to make the settings as a submenu of my plugin's menu page and there is no info on how to do this. Is it me or is getting started documentation completely useless?
Well, I wrote the docs, so I don't consider them completely useless, thanks. Did you read this? http://docs.reduxframework.com/redux-framework/getting-started/
Also, at the top of the new issue window you just filled out, you skipped over this link (https://github.com/ReduxFramework/redux-framework/blob/master/CONTRIBUTING.md). Please read it now and reply with the necessary information, should the previous post not work out for you.
I have read every documentation page available and absolutely nothing gets this thing to do anything. I've been trying to do this for 3 hours just to get the sample options to appear and beyond frustrated.
Version 3.2.8 WordPress 3.9 dev_mode? Embedded in plugin
Folder for Redux is admin/ReduxFramework Code to embed in admin/sunshine-admin.php is below:
if (!class_exists('ReduxFramework') && file_exists(dirname(FILE).'/ReduxFramework/ReduxCore/framework.php')) { require_once(dirname( FILE ) . '/ReduxFramework/ReduxCore/framework.php'); } if (!isset($redux_demo) && file_exists(dirname(FILE).'/ReduxFramework/sample/sample-config.php')) { require_once(dirname( FILE ) . '/ReduxFramework/sample/sample-config.php'); }
I put some extra echo statements in framework.php and sample-config.php to verify they are getting loaded - they are.
How about you try the generator? http://generator.reduxframework.com/
It works for countless others. Not sure what to tell you. The generator will get you started quick. Just export an admin folder. ;)
Issue was I load sunshine-admin.php in an init action. Moving out of the init action finally got it to load. Still no idea on how to add it as a submenu to my plugin though.
Ok, so yes. ReduxFramework runs before init. It runs the moment you call it. That way you can access the global variable from within your functions.php.
What do you mean add it as a submenu to your plugin?
With my current options framework, I have it appearing as a submenu for my plugin: http://screencast.com/t/GmoWPgCjG
First off, little suggestion. Being kind will get you kinder responses. You may be frustrated, but we don't owe you anything. If you're nice we'll help as we have the time.
Second, we have fantastic docs that you need to read more.
http://docs.reduxframework.com/redux-framework/arguments/menu_type/ http://docs.reduxframework.com/redux-framework/arguments/page_parent/
Those should get you what you need.
Apologies for the hostility, as a plugin developer who answers support I know what you mean.
I've tried every possible combination I can think of for those two options and I can never get it to appear under my plugin's main menu. When I use a direct call to add_submenu_page it appears, but then I get "You do not have permission" errors.
In digging into the Redux code, I found the "add_submenu" function. I went through there to see what it is trying to do. My $page_parent is not one of the items in the $test array so it assumes it is a "Network settings and Post type menus". But it shouldn't assume that since it is not in the $test array that it is either network settings or for a post type. My $page_parent is not "settings.php" but it also does not have "?post_type=" either so it fails both these and no menu is added. This is for my own custom menu "sunshine_admin" added by "add_menu_page". Redux doesn't appear to allow this.
Ahhhh. Good point. Skype me sometime. Dovydigital. Maybe you can help us solve that. ;)
I appreciate that too. I know it can be frustrating playing with someone else's code.
I am sure we can find a solution for the menu stuff. Shouldn't be too hard.
I thought we fixed this.
This is a layman breakdown of what we've done.
if Test for $page_parent array then
add_$page_parent_page
else
if $page_parent != 'settings.php' then
// Check for ?post_type via strpos
If strpos > 0 then
// do post_type stuff, etc, etc. Add memu if post type exists
elseif $page_parent exists in current $submenu array
// this is where your menu should be added.
add menu
endif
else
add menu for settings.php
endif
endif
You did fix it. It wasn't showing because i was running my "add_menu_page" action function at level 10 and Redux does the same. Redux got priority because it was called first in my plugin. So the parent_page for my plugin wasn't yet set. I dropped the level of my action function and then it showed and all worked fine.
Rough start but looking forward to fully implementing this.
Just FYI, user levels were depreciated in WP 3.0 and up. http://codex.wordpress.org/Roles_and_Capabilities
Not user level
add_action('admin_menu', 'sunshine_admin_menu', 10); vs add_action('admin_menu', 'sunshine_admin_menu', 0);
Oh, priority level. Gotcha. My bad.
Super glad you got it. ;)