Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Theme admin page
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2011 - 10:51 pm

Can themes hook in to the admin pages to add theme options? And is it done like this? And how do we detect admin pages or does it even matter?

add_action('sph_admin_menu', 'my_theme_admin_menu');

I'm really digging what you guys have made so far!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2011 - 10:59 pm

yes, they can...  but dont think you really want to use that hook...

take a look at some of the plugins, ie private messaging (new panel), subscriptions (add subpanel to users) as examples of how to do it... 

we have provided an api for adding admin pages... technically, its in the plugin api, but no reason themes cant use it too...  just put the stuff in the functions.php file of the theme...

holler if you need some more....

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2011 - 11:00 pm

Lee, if you have skype or google talk, can try to walk you through it if it helps...

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2011 - 11:42 pm

@Mr. Papa Thanks for the info. I was picking through the plugins to follow the examples. And then took a closer look at spa-admin-menu.php and think I have a pretty good grasp on what's going on. I guess I mainly was wondering if it was possible for a theme to hook in there or not without actually whipping up a test page.

Lately my geek time has really taken a hit so I've been spending my time studying the code rather then writing anything yet. I'm very excited about the possibilities I have to admit.

As much as I'd love to chat with ya... I'm afraid every set of headphones in the house have been destroyed by my three demon spawn... I mean little perfect children so Skype and such aren't a option.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2011 - 11:51 pm

lol... but contrary to what some think, both skype and google talk support text mode only...  but no worries...

interesting the comment above that hooks indicates where plugins and themes can add panels...  its certainly possible and it would add them to the left side menu (which you cannot do via the api)... 

but all you can really do from that hook is add new panel to the wp admin menu on the left...

might want to clarify that a bit...  and maybe see if it still works 😉

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2011 - 11:58 pm

and btw... that is the hook you use before 'using' the api functions to add new panels...  should be able to use the wp api also to add left hand nav panels... havent actually done that yet... but may try with pm right now...

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2011 - 12:05 am

ah, thats right… you cant really add a new menu item on the left side wp menu…  wp requires that any admin panels there be located in the plugins folder…  our sp plugins are not located in the plugins folder, so we havent solved a way around that…

also, relocated that hook to the bottom of that routine... makes more sense, especially if we solve the wp admin issue...

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2011 - 12:15 am

I can't help grinning. I didn't mean to launch you into a brainstorm frenzy over there!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2011 - 12:23 am

[Image Can Not Be Found][Image Can Not Be Found][Image Can Not Be Found]

well thought it odd that hook was there… and also then, why didnt I add new menus on the left for pm, tags and other plugins…  but as soon as I tried, it came crashing back into focus [Image Can Not Be Found]

but you can add menus to the accordion one - thats really the important one...

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2011 - 12:25 am

and I have been buried the last week or two in the new file uploader for 5.0.... so a good distraction!

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 638
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 615
Members: 17342
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10114
Posts: 79573