這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Wp Customizer Icon

描述

Wp Customizer Icon plugin is very easy to use. It contains 3696 material design icons. User can add extra icon classs to the icon library from there theme.
There is an filter hook named WPCI_customizer_icons by which user can marge extra icons class. Icon control name is WPCI_Customize_Icon_Control.
See the Github project repository.

螢幕截圖

  • This screenshot one.
  • This screenshot two.
  • This screenshot three.
  • This screenshot four.

安裝

  1. Upload plugin-name.php to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Now create customizer icon field by using WPCI_Customize_Icon_Control class in your theme.

Example:-

/**
 * Customizer register
 */
add_action( 'customize_register', 'mytheme_customize_register' );
function mytheme_customize_register( $wp_customize ) {
    $wp_customize->add_section(
            'test_section',
            array(
                'title' => __('Icon', 'wp-customizer-icon'),
                'priority' => 5,
            )
        );
    $wp_customize->add_setting(
            'test_icon',
            array(
                'default' => 'mdi mdi-access-point',
                'transport' => 'refresh',
            )
        );
    $wp_customize->add_control(
            new WPCI_Customize_Icon_Control(
                $wp_customize,
                'test_icon',
                array(
                    'type'      => 'icon',
                    'label' => __('Test Icon', 'wp-customizer-icon'),
                    'section' => 'test_section',
                    'priority' => 10,
                ))
    );
}

/**
 * Get Icon Class
 */
$icon_cls = get_theme_mod('test_icon');
echo '<i class="'.esc_attr( $icon_cls ).'"></i>';

Add extra icon library by filter hook named WPCI_customizer_icons.
Example:-

add_action('WPCI_customizer_icons','push_icon');
function push_icon($icon_array){
    $new_icon = array_merge(
        array(
            'fa fa-facebook' =>'fa fa-facebook',
            'fa fa-twitter' =>'fa fa-twitter'
        ),$icon_array
    );
    return $new_icon;
}

常見問題

Is there way to add extra icon library

Yes, there is an filter hook named WPCI_customizer_icons by which user can marge extra icons class.

評價

There are no reviews for this plugin.

貢獻者及開發者

“Wp Customizer Icon” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Wp Customizer Icon 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄