From b954c2cb4c314d69a4bacdc0047a8bfcead2ecfa Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Sun, 23 Sep 2012 14:21:10 -0500 Subject: [PATCH] Updating to 1.2 with conditional IE7 CSS --- README.md | 67 +++++++++++++++++++++++++----- plugin.php | 38 ++++++++--------- readme.txt | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 195 insertions(+), 30 deletions(-) create mode 100644 readme.txt diff --git a/README.md b/README.md index 6f136cd..9d318d2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,19 @@ -#Font Awesome WordPress Plugin +#Font Awesome Icons + +Contributors: rachelbaker + +Tags: icons, font-awesome, font icon, UI, icon font, bootstrap + +Requires at least: 3.0 + +Tested up to: 3.4.2 + +Stable tag: 1.2 + +License: GPLv3 or later + +License URI: http://www.gnu.org/licenses/gpl-3.0.html + Enables easy use of the Font Awesome icon font set from within WordPress. Icons can be inserted using either HTML or a shortcode. @@ -10,32 +25,64 @@ A full list of the 220 Font Awesome icons is available: [http://fortawesome.gith To use any of the Font Awesome icons on your WordPress site you have two options: -###1. HTML Option +__HTML Option__ All code examples on the Font Awesome site apply: [http://fortawesome.github.com/Font-Awesome/#code](http://fortawesome.github.com/Font-Awesome/#code) **Examples** -Pencil icon `` -Phone icon `` -Chevron left icon `` -###2. Shortcode Option +Pencil icon + +`` + +Phone icon + +`` + +Chevron left icon + +`` + +__Shortcode Option__ Don't want to worry about HTML tags? You can use a shortcode in your posts, pages and even widgets to display a Font Awesome icon. The shortcode to use is `[icon name=name-of-icon]`, where name=X is the class of the icon you would like to use. -**Examples** -Pencil icon `[icon name=icon-pencil]` -Phone icon `[icon name=icon-phone]` -Chevron left icon `[icon name=icon-chevron-left]` + +Pencil icon + +`[icon name=icon-pencil]` + +Phone icon + +`[icon name=icon-phone]` + +Chevron left icon + +`[icon name=icon-chevron-left]` ##Icons ![image](http://f.cl.ly/items/3Q3Z0Z30153Q3a2e3i1M/FontAwesome-Vectors.jpg) + +##Installation + +1. Upload Font Awesome Icons to the `/wp-content/plugins/` directory. + +2. Activate the plugin through the 'Plugins' menu in WordPress. + +3. Add shortcode to your posts, pages and even widgets to display a Font Awesome icon. + +The shortcode to use is `[icon name=name-of-icon]`, where name=X is the class of the icon you would like to use. + ##Release Notes +__Version 1.2__ + +Added IE7 conditional stylesheet + __Version 1.1__ Created and enabled shortcode diff --git a/plugin.php b/plugin.php index 8689260..f7388ed 100644 --- a/plugin.php +++ b/plugin.php @@ -2,10 +2,10 @@ /* Plugin Name: Font Awesome Icons Plugin URI: http://www.rachelbaker.me -Description: Font Awesome (http://fortawesome.github.com/Font-Awesome) Icons for use in WordPress. -Version: 1.1 +Description: Use the Font Awesome icon set within WordPress. Icons can be inserted using either HTML or a shortcode. +Version: 1.2 Author: Rachel Baker -Author URI: http://www.rachelbaker.me +Author URI: http://rachelbaker.me/font-awesome-icons-wordpress-plugins/ Author Email: rachel@rachelbaker.me Credits: The Font Awesome icon set was created by Dave Gandy (dave@davegandy.com) @@ -30,33 +30,31 @@ */ -class FontAwesome -{ - public function __construct() - { +class FontAwesome { + public function __construct() { add_action( 'init', array( &$this, 'init' ) ); } - public function init() - { + public function init() { add_action( 'wp_enqueue_scripts', array( &$this, 'register_plugin_styles' ) ); - add_shortcode('icon', array( &$this, 'setup_shortcode' ) ); - add_filter('widget_text', 'do_shortcode'); + add_shortcode( 'icon', array( &$this, 'setup_shortcode' ) ); + add_filter( 'widget_text', 'do_shortcode' ); } - public function register_plugin_styles() - { + public function register_plugin_styles() { + global $wp_styles; wp_enqueue_style( 'font-awesome-styles', plugins_url( 'assets/css/font-awesome.css', __FILE__ ) ); + wp_enqueue_style( 'font-awesome-ie7', plugins_url( 'assets/css/font-awesome-ie7.css', __FILE__ ), array(), '1.0', 'all' ); + $wp_styles->add_data( 'font-awesome-ie7', 'conditional', 'lte IE 7' ); } - public function setup_shortcode($params) - { - extract( shortcode_atts( array( - 'name' => 'icon-wrench' - ), $params)); - $icon = ' '; + public function setup_shortcode( $params ) { + extract( shortcode_atts( array( + 'name' => 'icon-wrench' + ), $params ) ); + $icon = ' '; - return $icon; + return $icon; } } diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..6e22e7e --- /dev/null +++ b/readme.txt @@ -0,0 +1,120 @@ +=== Font Awesome Icons === +Contributors: rachelbaker +Tags: icons, font-awesome, font icon, UI, icon font, bootstrap +Requires at least: 3.0 +Tested up to: 3.4.2 +Stable tag: 1.2 +License: GPLv3 or later +License URI: http://www.gnu.org/licenses/gpl-3.0.html + + +Enables easy use of the Font Awesome icon font set from within WordPress. Icons can be inserted using either HTML or a shortcode. + +== Description == + +Font Awesome is a pictographic font set of 220 icons. The icons are infitinely scalable and screen reader compatible. + +A full list of the 220 Font Awesome icons is available: [http://fortawesome.github.com/Font-Awesome/#all-icons](http://fortawesome.github.com/Font-Awesome/#all-icons) + + +To use any of the Font Awesome icons on your WordPress site you have two options: + +__HTML Option__ + +All code examples on the Font Awesome site apply: [http://fortawesome.github.com/Font-Awesome/#code](http://fortawesome.github.com/Font-Awesome/#code) + +**Examples** + +Pencil icon + +`` + +Phone icon + +`` + +Chevron left icon + +`` + +__Shortcode Option__ + +Don't want to worry about HTML tags? You can use a shortcode in your posts, pages and even widgets to display a Font Awesome icon. + +The shortcode to use is `[icon name=name-of-icon]`, where name=X is the class of the icon you would like to use. + + +Pencil icon + +`[icon name=icon-pencil]` + +Phone icon + +`[icon name=icon-phone]` + +Chevron left icon + +`[icon name=icon-chevron-left]` + + +__Credits__ + + * Font Awesome webfont and associated code are licensed under CC BY 3.0 and is a production of @fortaweso_me, by Dave Gandy. + +__Contributors Welcome__ + +* Submit a [pull request on Github](https://github.com/rachelbaker/Font-Awesome-WordPress-Plugin) + +__Author__ + +* [Rachel Baker](http://rachelbaker.me) + += Icons = + +![image](http://f.cl.ly/items/3Q3Z0Z30153Q3a2e3i1M/FontAwesome-Vectors.jpg) + +== Installation == + +1. Upload Font Awesome Icons to the `/wp-content/plugins/` directory. + +2. Activate the plugin through the 'Plugins' menu in WordPress. + +3. Add shortcode to your posts, pages and even widgets to display a Font Awesome icon. + +The shortcode to use is `[icon name=name-of-icon]`, where name=X is the class of the icon you would like to use. + +**Example:** + +`[icon name=icon-pencil]` + + +4. You can use HTML by adding the appropiate class to the `` element. + +All code examples on the Font Awesome site apply: [http://fortawesome.github.com/Font-Awesome/#code](http://fortawesome.github.com/Font-Awesome/#code) + +**Example:** + +`` + + +== Screenshots == + +1. HTML code samples +2. Shortcode samples +3. Full icon list + + + +== Changelog == + += 1.2 = + +* Added IE7 CSS + += 1.1 = + +* Created and enabled shortcode + += 1.0 = + +* Initial release \ No newline at end of file