Skip to content

awethemes/wp-simple-iconfonts

Repository files navigation

WP Simple Iconfonts

An icon fonts manager and picker for WordPress

screenshot-2

Introduction

If you looking for an icon picker, this's last choice your need.

Features

  • Allow you import/register unlimit icon fonts in to your site and manager them.
  • Provider a picker-icon, integrated with almost popular WordPress plugins, frameworks, etc...
  • Fluent API, easy use for other.

Links

Integration

Icon-picker

WP Simple Iconfonts supports almost popular WP framework, metabox... just use a 'type' => 'simple_iconfonts' to display icon picker field.

List currently support icon-picker field/control:

See the example to see how it works.

We also have a function to display picker field, checkout this example:

<?php

// Get value from database...
$values = array(
	'type' => '',
	'icon' => '',
);

wp_simple_iconfonts_field( array(
	'id'    => '_simple_icon',
	'name'  => '_simple_icon',
	'value' => $values
) );

How I add my icon pack in PHP?

Checkout this very simple example:

NOTE: An icon pack registerd via PHP will be set "lock" status, you can't deactive or remove it from dashboard.

<?php

function register_new_icons( $iconfonts ) {
    $iconpack = new \WP_Simple_Iconfonts\Iconpack(array(
        'id'             => 'dashicons',
        'name'           => 'Display name',
        'version'        => '0.1.1',
        'stylesheet_uri' => 'maybe_same_your_id',
        'stylesheet_uri' => 'https://your-site.com/path-to-styles.css',
        $groups = array(
            array(
                'id'   => 'admin',
                'name' => 'Admin',
            ),
            array(
                'id'   => 'post-formats',
                'name' => 'Post Formats',
            ),
        ),
        'icons'          => array(
            array(
                'id'    => 'dashicons-admin-appearance',
                'name'  => 'Appearance',
                'group' => 'admin',
            ),
            array(
                'id'    => 'dashicons-admin-collapse',
                'name'  => 'Collapse',
                'group' => 'admin',
            ),
            array(
                'id'    => 'dashicons-format-standard',
                'name'  => 'Standard',
                'group' => 'post-formats',
            ),
        ),

    ));

    $iconfonts->register( $iconpack );
}
add_action( 'wp_simple_iconfonts', 'register_new_icons' );

Supports