define('DISALLOW_FILE_EDIT', true);{"id":503,"date":"2010-09-04T14:16:29","date_gmt":"2010-09-04T19:16:29","guid":{"rendered":"http:\/\/www.unfocus.com\/"},"modified":"2013-08-27T15:18:17","modified_gmt":"2013-08-27T19:18:17","slug":"scripts-n-styles","status":"publish","type":"page","link":"http:\/\/www.unfocus.com\/projects\/scripts-n-styles\/","title":{"rendered":"Scripts n Styles"},"content":{"rendered":"
Introducing a new WordPress plugin from unFocus Projects: Scripts n Styles!<\/p>\n
We wrote this plugin because sometimes you just need a small bit of JavaScript or CSS only on one page or post, but it isn’t very convenient to create a whole new template or write a complicated filter in your theme’s function file just for this.<\/p>\n
This plugin allows Admin users the ability to add custom CSS and JavaScript directly into individual Post, Pages or any other registered custom post types.<\/p>\n
Because only well trusted users should ever be allowed to insert JavaScript directly into the pages of your site, this plugin restricts usage to admin type users. Admin’s have access to even more sensitive areas by definition, so that should be relatively safe \ud83d\ude09<\/p><\/blockquote>\n
For example, if you check the source code of this page (or view the element with Firebug), you should see in the following rule:<\/p>\n
[css]<\/p>\n
.syntaxhighlighter { border: 1px solid blue; }<\/p>\n
[\/css]<\/p>\n
This was simply included only on this page by using the Styles meta box on the page edit screen.<\/p>\n
A few notes about the implementation:<\/p>\n
\n
- Admin users, or more specifically, *any user with the `manage_options` capability* (which by default is *only* the admin type user) can use this plugin’s functionality. Some plugins extend user rolls, and so this plugin would naturally extend include rolls that have the appropriate capability.<\/li>\n
- CSS Styles are included inline, not linked, at the bottom of the `head` element with `style` tags by using `wp-head`. If your theme doesn’t have this hook, this plugin (as well as most others) won’t work.<\/li>\n
- JavaScript is included inline, not linked, at the bottom of the `body` element with `script` tags by using `wp-footer`. If your theme doesn’t have this hook, this plugin (as well as most others) won’t work.<\/li>\n
- There is no input validation<\/strong>. This plugin puts exactly what you type in the meta box directly into the `html` with no error checking. You are an Admin, and we trust you to be carefull. Try not to break anything.<\/li>\n<\/ul>\n
Current version: 3.3.<\/p>\n
If you’d like to contribute, the development is at github<\/a> and since the plugin is GPLv3+, feel free to fork it up!<\/p>\n
The plugin is available at the wordpress.org repos<\/a> in it’s stable form<\/p>\n
(This plugin was inspired by an article at digwp.com<\/a>.)<\/p>\n","protected":false},"excerpt":{"rendered":"
Introducing a new WordPress plugin from unFocus Projects: Scripts n Styles! We wrote this plugin because sometimes you just need a small bit of JavaScript or CSS only on one page or post, but it isn’t very convenient to create a whole new template or write a complicated filter in your theme’s function file just … Continue reading “Scripts n Styles”<\/span><\/a><\/p>\n","protected":false},"author":1797,"featured_media":0,"parent":35,"menu_order":1,"comment_status":"open","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/pages\/503"}],"collection":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/users\/1797"}],"replies":[{"embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/comments?post=503"}],"version-history":[{"count":29,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/pages\/503\/revisions"}],"predecessor-version":[{"id":4318,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/pages\/503\/revisions\/4318"}],"up":[{"embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/pages\/35"}],"wp:attachment":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/media?parent=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}