JeremyEnglert / JointsWP-CSS

A blank WordPress theme built with Foundation 6, giving you all the power and flexibility you need to build complex, mobile friendly websites without having to start from scratch.
http://jointswp.com
75 stars 23 forks source link

script.js not loaded on admin pages ? #8

Closed Adrien-Luxey closed 9 years ago

Adrien-Luxey commented 9 years ago

Hi there!

First of all, thanks a lot for your theme! I'm having a lot of fun reading through you huge blocks of welcoming comments, thus improving my Wordpress skills and creating cool designs for different people: life is cool. Furthermore, I have been looking for that kind of theme for ages! I ended up tossing SCSS which causes more issues than solutions in my situation, so I'm glad you provided both versions.

Still, I am surprised to see that you only load /library/js/script.js in the non admin pages. This is written the function joints_scripts_and_styles() in /library/joints.php. I can understand that you don't really need Foundation in admin pages, but what about Gravatar ? Plus your comment in script.js says we have to (well, can) add our js code here. I wanted to add jQuery UI datepicker for a custom type in the admin section, and spent a little time figuring it out (finding the right if statement... Don't blame me it's late!).

No big deal, though, I'm mostly being curious. Thanks again for the theme! Adrien

JeremyEnglert commented 9 years ago

This is pretty normal behavior. If you want to call scripts on the admin pages, you'll want to use the admin_enqueue_scripts action.

http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts

Glad you're enjoying the theme!