Skip to content

Commit

Permalink
Updating to 1.2 with conditional IE7 CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelbaker committed Sep 23, 2012
1 parent 6cdf1a0 commit b954c2c
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 30 deletions.
67 changes: 57 additions & 10 deletions 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.

Expand All @@ -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 `<i class="icon-pencil"></i>`
Phone icon `<i class="icon-phone"></i>`
Chevron left icon `<i class="icon-chevron-left"></i>`

###2. Shortcode Option
Pencil icon

`<i class="icon-pencil"></i>`

Phone icon

`<i class="icon-phone"></i>`

Chevron left icon

`<i class="icon-chevron-left"></i>`

__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
Expand Down
38 changes: 18 additions & 20 deletions plugin.php
Expand Up @@ -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)
Expand All @@ -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 = '<i class="'.$params['name'].'">&nbsp;</i>';
public function setup_shortcode( $params ) {
extract( shortcode_atts( array(
'name' => 'icon-wrench'
), $params ) );
$icon = '<i class="'.$params['name'].'">&nbsp;</i>';

return $icon;
return $icon;
}

}
Expand Down
120 changes: 120 additions & 0 deletions 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

`<i class="icon-pencil"></i>`

Phone icon

`<i class="icon-phone"></i>`

Chevron left icon

`<i class="icon-chevron-left"></i>`

__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 `<i>` 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:**

`<i class="icon-pencil"></i>`


== 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

0 comments on commit b954c2c

Please sign in to comment.