Initial commit
This commit is contained in:
104
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/fields/base.php
vendored
Normal file
104
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/fields/base.php
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
if ( ! function_exists( 'wp_get_attachment_image_url' ) ) {
|
||||
/**
|
||||
* Get the URL of an image attachment.
|
||||
*
|
||||
* @since WordPress 4.4.0
|
||||
*
|
||||
* @param int $attachment_id Image attachment ID.
|
||||
* @param string|array $size Optional. Image size to retrieve. Accepts any valid image size, or an array
|
||||
* of width and height values in pixels (in that order). Default 'thumbnail'.
|
||||
* @param bool $icon Optional. Whether the image should be treated as an icon. Default false.
|
||||
* @return string|false Attachment URL or false if no image is available.
|
||||
*/
|
||||
function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) {
|
||||
$image = wp_get_attachment_image_src( $attachment_id, $size, $icon );
|
||||
return isset( $image['0'] ) ? $image['0'] : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Icon URL
|
||||
*
|
||||
* @since 0.2.0
|
||||
*
|
||||
* @param string $type Icon type.
|
||||
* @param mixed $id Icon ID.
|
||||
* @param string $size Optional. Icon size, defaults to 'thumbnail'.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function icon_picker_get_icon_url( $type, $id, $size = 'thumbnail' ) {
|
||||
$url = '';
|
||||
|
||||
if ( ! in_array( $type, array( 'image', 'svg' ), true ) ) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
if ( empty( $id ) ) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
return wp_get_attachment_image_url( $id, $size, false );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The Icon Picker Field
|
||||
*
|
||||
* @since 0.2.0
|
||||
*
|
||||
* @param mixed $args {
|
||||
* }
|
||||
* @param bool $echo Whether to return the field or print it. Defaults to TRUE.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function icon_picker_field( $args, $echo = true ) {
|
||||
$defaults = array(
|
||||
'id' => '',
|
||||
'name' => '',
|
||||
'value' => array(
|
||||
'type' => '',
|
||||
'icon' => '',
|
||||
),
|
||||
'select' => sprintf( '<a class="ipf-select">%s</a>', esc_html__( 'Select Icon', 'icon-picker-field' ) ),
|
||||
'remove' => sprintf( '<a class="ipf-remove button hidden">%s</a>', esc_html__( 'Remove', 'icon-picker-field' ) ),
|
||||
);
|
||||
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
$args['value'] = wp_parse_args( $args['value'], $defaults['value'] );
|
||||
|
||||
$field = sprintf( '<div id="%s" class="ipf">', $args['id'] );
|
||||
$field .= $args['select'];
|
||||
$field .= $args['remove'];
|
||||
|
||||
foreach ( $args['value'] as $key => $value ) {
|
||||
$field .= sprintf(
|
||||
'<input type="hidden" id="%s" name="%s" class="%s" value="%s" />',
|
||||
esc_attr( "{$args['id']}-{$key}" ),
|
||||
esc_attr( "{$args['name']}[{$key}]" ),
|
||||
esc_attr( "ipf-{$key}" ),
|
||||
esc_attr( $value )
|
||||
);
|
||||
}
|
||||
|
||||
// This won't be saved. It's here for the preview.
|
||||
$field .= sprintf(
|
||||
'<input type="hidden" class="url" value="%s" />',
|
||||
esc_attr( icon_picker_get_icon_url( $args['value']['type'], $args['value']['icon'] ) )
|
||||
);
|
||||
$field .= '</div>';
|
||||
|
||||
if ( $echo ) {
|
||||
echo $field; // xss ok
|
||||
} else {
|
||||
return $field;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add-ons for other plugins.
|
||||
|
48
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/fields/cmb.php
vendored
Normal file
48
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/fields/cmb.php
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 'icon' field type for Custom Meta Boxes
|
||||
*
|
||||
* @link https://github.com/humanmade/Custom-Meta-Boxes/wiki/Adding-your-own-field-types CMB Wiki
|
||||
* @version 0.1.1
|
||||
* @since Icon_Picker 0.2.0
|
||||
*/
|
||||
class Icon_Picker_Field_Cmb extends CMB_Field {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @see {CMB_Field::__construct()}
|
||||
*/
|
||||
public function __construct( $name, $title, array $values, $args = array() ) {
|
||||
parent::__construct( $name, $title, $values, $args );
|
||||
Icon_Picker::instance()->load();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse save values
|
||||
*
|
||||
* When used as a sub-field of a `group` field, wrap the values with array.
|
||||
*
|
||||
* @since 0.1.1
|
||||
*/
|
||||
public function parse_save_values() {
|
||||
if ( ! empty( $this->parent ) ) {
|
||||
$this->values = array( $this->values );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the field
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @see {CMB_Field::html()}
|
||||
*/
|
||||
public function html() {
|
||||
icon_picker_field( array(
|
||||
'id' => $this->id,
|
||||
'name' => $this->get_the_name_attr(),
|
||||
'value' => $this->get_value(),
|
||||
) );
|
||||
}
|
||||
}
|
285
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/fontpack.php
vendored
Normal file
285
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/fontpack.php
vendored
Normal file
@ -0,0 +1,285 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Fontpack
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @version 0.1.0
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
|
||||
final class Icon_Picker_Fontpack {
|
||||
|
||||
/**
|
||||
* Icon_Picker_Fontpack singleton
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var Icon_Picker_Fontpack
|
||||
*/
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* Fontpack directory path
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $dir;
|
||||
|
||||
/**
|
||||
* Fontpack directory url path
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $url;
|
||||
|
||||
/**
|
||||
* Error messages
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $messages = array();
|
||||
|
||||
/**
|
||||
* Icon packs
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $packs = array();
|
||||
|
||||
|
||||
/**
|
||||
* Get instance
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @return Icon_Picker_Fontpack
|
||||
*/
|
||||
public static function instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $name Property name.
|
||||
* @return mixed NULL if attribute doesn't exist.
|
||||
*/
|
||||
public function __get( $name ) {
|
||||
if ( isset( $this->$name ) ) {
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset( $name ) {
|
||||
return isset( $this->$name );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return Icon_Picker_Fontpack
|
||||
*/
|
||||
protected function __construct() {
|
||||
/**
|
||||
* Allow different system path for fontpacks
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $dir Directory path, defaults to /wp-content/fontpacks.
|
||||
*/
|
||||
$this->dir = apply_filters( 'icon_picker_fontpacks_dir_path', WP_CONTENT_DIR . '/fontpacks' );
|
||||
|
||||
if ( ! is_readable( $this->dir ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow different URL path for fontpacks
|
||||
*
|
||||
* @since 0.4.0
|
||||
* @param string $url URL path, defaults to /wp-content/fontpacks
|
||||
*/
|
||||
$this->url = apply_filters( 'icon_picker_fontpacks_dir_url', WP_CONTENT_URL . '/fontpacks' );
|
||||
|
||||
$this->messages = array(
|
||||
'no_config' => __( 'Icon Picker: %1$s was not found in %2$s.', 'icon-picker' ),
|
||||
'config_error' => __( 'Icon Picker: %s contains an error or more.', 'icon-picker' ),
|
||||
'invalid' => __( 'Icon Picker: %1$s is not set or invalid in %2$s.', 'icon-picker' ),
|
||||
'duplicate' => __( 'Icon Picker: %1$s is already registered. Please check your font pack config file: %2$s.', 'icon-picker' ),
|
||||
);
|
||||
|
||||
$this->collect_packs();
|
||||
$this->register_packs();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Collect icon packs
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function collect_packs() {
|
||||
$iterator = new DirectoryIterator( $this->dir );
|
||||
|
||||
foreach ( $iterator as $pack_dir ) {
|
||||
if ( $pack_dir->isDot() || ! $pack_dir->isDir() || ! $pack_dir->isReadable() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$pack_dirname = $pack_dir->getFilename();
|
||||
$pack_data = $this->get_pack_data( $pack_dir );
|
||||
|
||||
if ( ! empty( $pack_data ) ) {
|
||||
$this->packs[ $pack_dirname ] = $pack_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register icon packs
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function register_packs() {
|
||||
if ( empty( $this->packs ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$icon_picker = Icon_Picker::instance();
|
||||
require_once "{$icon_picker->dir}/includes/types/fontello.php";
|
||||
|
||||
foreach ( $this->packs as $pack_data ) {
|
||||
$icon_picker->registry->add( new Icon_Picker_Type_Fontello( $pack_data ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get icon pack data
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @param DirectoryIterator $pack_dir Icon pack directory object.
|
||||
* @return array Icon pack data array or FALSE.
|
||||
*/
|
||||
protected function get_pack_data( DirectoryIterator $pack_dir ) {
|
||||
$pack_dirname = $pack_dir->getFilename();
|
||||
$pack_path = $pack_dir->getPathname();
|
||||
$cache_id = "icon_picker_fontpack_{$pack_dirname}";
|
||||
$cache_data = get_transient( $cache_id );
|
||||
$config_file = "{$pack_path}/config.json";
|
||||
|
||||
if ( false !== $cache_data && $cache_data['version'] === $pack_dir->getMTime() ) {
|
||||
return $cache_data;
|
||||
}
|
||||
|
||||
// Make sure the config file exists and is readable.
|
||||
if ( ! is_readable( $config_file ) ) {
|
||||
trigger_error(
|
||||
sprintf(
|
||||
esc_html( $this->messages['no_config'] ),
|
||||
'<code>config.json</code>',
|
||||
sprintf( '<code>%s</code>', esc_html( $pack_path ) )
|
||||
)
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$config = json_decode( file_get_contents( $config_file ), true );
|
||||
$errors = json_last_error();
|
||||
|
||||
if ( ! empty( $errors ) ) {
|
||||
trigger_error(
|
||||
sprintf(
|
||||
esc_html( $this->messages['config_error'] ),
|
||||
sprintf( '<code>%s/config.json</code>', esc_html( $pack_path ) )
|
||||
)
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$keys = array( 'name', 'glyphs', 'css_prefix_text' );
|
||||
$items = array();
|
||||
|
||||
// Check each required config.
|
||||
foreach ( $keys as $key ) {
|
||||
if ( empty( $config[ $key ] ) ) {
|
||||
trigger_error(
|
||||
sprintf(
|
||||
esc_html( $this->messages['invalid'] ),
|
||||
sprintf( '<code><em>%s</em></code>', esc_html( $key ) ),
|
||||
esc_html( $config_file )
|
||||
)
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Bail if no glyphs found.
|
||||
if ( ! is_array( $config['glyphs'] ) || empty( $config['glyphs'] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ( $config['glyphs'] as $glyph ) {
|
||||
if ( ! empty( $glyph['css'] ) ) {
|
||||
$items[] = array(
|
||||
'id' => $config['css_prefix_text'] . $glyph['css'],
|
||||
'name' => $glyph['css'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $items ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$pack_data = array(
|
||||
'id' => "pack-{$config['name']}",
|
||||
'name' => sprintf( __( 'Pack: %s', 'icon-picker' ), $config['name'] ),
|
||||
'version' => $pack_dir->getMTime(),
|
||||
'items' => $items,
|
||||
'stylesheet_uri' => "{$this->url}/{$pack_dirname}/css/{$config['name']}.css",
|
||||
'dir' => "{$this->dir}/{$pack_dirname}",
|
||||
'url' => "{$this->url}/{$pack_dirname}",
|
||||
);
|
||||
|
||||
set_transient( $cache_id, $pack_data, DAY_IN_SECONDS );
|
||||
|
||||
return $pack_data;
|
||||
}
|
||||
}
|
335
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/loader.php
vendored
Normal file
335
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/loader.php
vendored
Normal file
@ -0,0 +1,335 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Icon Picker Loader
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
|
||||
final class Icon_Picker_Loader {
|
||||
|
||||
/**
|
||||
* Icon_Picker_Loader singleton
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var Icon_Picker_Loader
|
||||
*/
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* Script IDs
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $script_ids = array();
|
||||
|
||||
/**
|
||||
* Stylesheet IDs
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $style_ids = array();
|
||||
|
||||
/**
|
||||
* Printed media templates
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $printed_templates = array();
|
||||
|
||||
|
||||
/**
|
||||
* Setter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $name Property name.
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset( $name ) {
|
||||
return isset( $this->$name );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $name Property name.
|
||||
* @return mixed NULL if attribute doesn't exist.
|
||||
*/
|
||||
public function __get( $name ) {
|
||||
if ( isset( $this->$name ) ) {
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get instance
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return Icon_Picker_Loader
|
||||
*/
|
||||
public static function instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
*/
|
||||
protected function __construct() {
|
||||
$this->register_assets();
|
||||
|
||||
add_filter( 'media_view_strings', array( $this, '_media_view_strings' ) );
|
||||
|
||||
/**
|
||||
* Fires when Icon Picker loader is ready
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param Icon_Picker_Loader $this Icon_Picker_Loader instance.
|
||||
*/
|
||||
do_action( 'icon_picker_loader_init', $this );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add script
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $script_id Script ID.
|
||||
* @return bool
|
||||
*/
|
||||
public function add_script( $script_id ) {
|
||||
if ( wp_script_is( $script_id, 'registered' ) ) {
|
||||
$this->script_ids[] = $script_id;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add stylesheet
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $stylesheet_id Stylesheet ID.
|
||||
* @return bool
|
||||
*/
|
||||
public function add_style( $stylesheet_id ) {
|
||||
if ( wp_style_is( $stylesheet_id, 'registered' ) ) {
|
||||
$this->style_ids[] = $stylesheet_id;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register scripts & styles
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @since 0.5.0 Use webpack dev server's URL as the asset URL.
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function register_assets() {
|
||||
$icon_picker = Icon_Picker::instance();
|
||||
|
||||
if ( defined( 'ICON_PICKER_SCRIPT_DEBUG' ) && ICON_PICKER_SCRIPT_DEBUG ) {
|
||||
$assets_url = '//localhost:8080';
|
||||
$suffix = '';
|
||||
} else {
|
||||
$assets_url = $icon_picker->url;
|
||||
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
||||
}
|
||||
|
||||
wp_register_script(
|
||||
'icon-picker',
|
||||
"{$assets_url}/js/icon-picker{$suffix}.js",
|
||||
array( 'media-views' ),
|
||||
Icon_Picker::VERSION,
|
||||
true
|
||||
);
|
||||
$this->add_script( 'icon-picker' );
|
||||
|
||||
wp_register_style(
|
||||
'icon-picker',
|
||||
"{$icon_picker->url}/css/icon-picker{$suffix}.css",
|
||||
false,
|
||||
Icon_Picker::VERSION
|
||||
);
|
||||
$this->add_style( 'icon-picker' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load admin functionalities
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return void
|
||||
*/
|
||||
public function load() {
|
||||
if ( ! is_admin() ) {
|
||||
_doing_it_wrong(
|
||||
__METHOD__,
|
||||
'It should only be called on admin pages.',
|
||||
esc_html( Icon_Picker::VERSION )
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! did_action( 'icon_picker_loader_init' ) ) {
|
||||
_doing_it_wrong(
|
||||
__METHOD__,
|
||||
sprintf(
|
||||
'It should not be called until the %s hook.',
|
||||
'<code>icon_picker_loader_init</code>'
|
||||
),
|
||||
esc_html( Icon_Picker::VERSION )
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( $this, '_enqueue_assets' ) );
|
||||
add_action( 'print_media_templates', array( $this, '_media_templates' ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Filter media view strings
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @wp_hook filter media_view_strings
|
||||
*
|
||||
* @param array $strings Media view strings.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function _media_view_strings( $strings ) {
|
||||
$strings['iconPicker'] = array(
|
||||
'frameTitle' => __( 'Icon Picker', 'icon-picker' ),
|
||||
'allFilter' => __( 'All', 'icon-picker' ),
|
||||
'selectIcon' => __( 'Select Icon', 'icon-picker' ),
|
||||
);
|
||||
|
||||
return $strings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enqueue scripts & styles
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @wp_hook action admin_enqueue_scripts
|
||||
* @return void
|
||||
*/
|
||||
public function _enqueue_assets() {
|
||||
$icon_picker = Icon_Picker::instance();
|
||||
|
||||
wp_localize_script(
|
||||
'icon-picker',
|
||||
'iconPicker',
|
||||
array(
|
||||
'types' => $icon_picker->registry->get_types_for_js(),
|
||||
)
|
||||
);
|
||||
|
||||
// Some pages don't call this by default, so let's make sure.
|
||||
wp_enqueue_media();
|
||||
|
||||
foreach ( $this->script_ids as $script_id ) {
|
||||
wp_enqueue_script( $script_id );
|
||||
}
|
||||
|
||||
foreach ( $this->style_ids as $style_id ) {
|
||||
wp_enqueue_style( $style_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when admin functionality is loaded
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param Icon_Picker $icon_picker Icon_Picker instance.
|
||||
*/
|
||||
do_action( 'icon_picker_admin_loaded', $icon_picker );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Media templates
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @wp_hook action print_media_templates
|
||||
* @return void
|
||||
*/
|
||||
public function _media_templates() {
|
||||
$icon_picker = Icon_Picker::instance();
|
||||
|
||||
foreach ( $icon_picker->registry->types as $type ) {
|
||||
if ( empty( $type->templates ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$template_id_prefix = "tmpl-iconpicker-{$type->template_id}";
|
||||
if ( in_array( $template_id_prefix, $this->printed_templates, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ( $type->templates as $template_id_suffix => $template ) {
|
||||
$this->_print_template( "{$template_id_prefix}-{$template_id_suffix}", $template );
|
||||
}
|
||||
|
||||
$this->printed_templates[] = $template_id_prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after all media templates have been printed
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param Icon_Picker $icon_picker Icon Picker instance.
|
||||
*/
|
||||
do_action( 'icon_picker_print_media_templates', $icon_picker );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print media template
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $id Template ID.
|
||||
* @param string $template Media template HTML.
|
||||
* @return void
|
||||
*/
|
||||
protected function _print_template( $id, $template ) {
|
||||
?>
|
||||
<script type="text/html" id="<?php echo esc_attr( $id ) ?>">
|
||||
<?php echo $template; // xss ok ?>
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
178
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/registry.php
vendored
Normal file
178
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/registry.php
vendored
Normal file
@ -0,0 +1,178 @@
|
||||
<?php
|
||||
/**
|
||||
* Icon types registry
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
|
||||
final class Icon_Picker_Types_Registry {
|
||||
|
||||
/**
|
||||
* Icon_Picker_Types_Registry singleton
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var Icon_Picker_Types_Registry
|
||||
*/
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* Base icon type class name
|
||||
*
|
||||
* @access protected
|
||||
* @since 0.1.0
|
||||
* @var string
|
||||
*/
|
||||
protected $base_class = 'Icon_Picker_Type';
|
||||
|
||||
/**
|
||||
* All types
|
||||
*
|
||||
* @access protected
|
||||
* @since 0.1.0
|
||||
* @var array
|
||||
*/
|
||||
protected $types = array();
|
||||
|
||||
|
||||
/**
|
||||
* Get instance
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @param array $args Arguments.
|
||||
*
|
||||
* @return Icon_Picker_Types_Registry
|
||||
*/
|
||||
public static function instance( $args = array() ) {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self( $args );
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $name Property name.
|
||||
* @return mixed NULL if attribute doesn't exist.
|
||||
*/
|
||||
public function __get( $name ) {
|
||||
if ( isset( $this->$name ) ) {
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset( $name ) {
|
||||
return isset( $this->$name );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return Icon_Picker_Types_Registry
|
||||
*/
|
||||
protected function __construct() {
|
||||
/**
|
||||
* Fires when Icon Picker types registry is ready
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param Icon_Picker_Types_Registry $this Icon_Picker_Types_Registry instance.
|
||||
*/
|
||||
do_action( 'icon_picker_types_registry_init', $this );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register icon type
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param Icon_Picker_Type $type Icon type.
|
||||
* @return void
|
||||
*/
|
||||
public function add( Icon_Picker_Type $type ) {
|
||||
if ( $this->is_valid_type( $type ) ) {
|
||||
$this->types[ $type->id ] = $type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get icon type
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $id Icon type ID.
|
||||
* @return mixed Icon type or NULL if it's not registered.
|
||||
*/
|
||||
public function get( $id ) {
|
||||
if ( isset( $this->types[ $id ] ) ) {
|
||||
return $this->types[ $id ];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if icon type is valid
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param Icon_Picker_Type $type Icon type.
|
||||
* @return bool
|
||||
*/
|
||||
protected function is_valid_type( Icon_Picker_Type $type ) {
|
||||
foreach ( array( 'id', 'controller' ) as $var ) {
|
||||
$value = $type->$var;
|
||||
|
||||
if ( empty( $value ) ) {
|
||||
trigger_error( esc_html( sprintf( 'Icon Picker: "%s" cannot be empty.', $var ) ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $this->types[ $type->id ] ) ) {
|
||||
trigger_error( esc_html( sprintf( 'Icon Picker: Icon type %s is already registered. Please use a different ID.', $type->id ) ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all icon types for JS
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_types_for_js() {
|
||||
$types = array();
|
||||
$names = array();
|
||||
|
||||
foreach ( $this->types as $type ) {
|
||||
$types[ $type->id ] = $type->get_props();
|
||||
$names[ $type->id ] = $type->name;
|
||||
}
|
||||
|
||||
array_multisort( $names, SORT_ASC, $types );
|
||||
|
||||
return $types;
|
||||
}
|
||||
}
|
152
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/base.php
vendored
Normal file
152
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/base.php
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* Icon type handler
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Base icon type class
|
||||
*/
|
||||
class Icon_Picker_Type {
|
||||
|
||||
/**
|
||||
* Icon type ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $id = '';
|
||||
|
||||
/**
|
||||
* Icon type name
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $name = '';
|
||||
|
||||
/**
|
||||
* Icon type version
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $version = '';
|
||||
|
||||
/**
|
||||
* JS Controller
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $controller = '';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Supplied $args override class property defaults.
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $args Optional. Arguments to override class property defaults.
|
||||
*/
|
||||
public function __construct( $args = array() ) {
|
||||
$keys = array_keys( get_object_vars( $this ) );
|
||||
|
||||
foreach ( $keys as $key ) {
|
||||
if ( isset( $args[ $key ] ) ) {
|
||||
$this->$key = $args[ $key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param string $name Property name
|
||||
* @return mixed NULL if attribute doesn't exist.
|
||||
*/
|
||||
public function __get( $name ) {
|
||||
$vars = get_object_vars( $this );
|
||||
if ( isset( $vars[ $name ] ) ) {
|
||||
return $vars[ $name ];
|
||||
}
|
||||
|
||||
$method = "get_{$name}";
|
||||
if ( method_exists( $this, $method ) ) {
|
||||
return call_user_func( array( $this, $method ) );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setter magic
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset( $name ) {
|
||||
return ( isset( $this->$name ) || method_exists( $this, "get_{$name}" ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get extra properties data
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function get_props_data() {
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get properties
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_props() {
|
||||
$props = array(
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'controller' => $this->controller,
|
||||
'templateId' => $this->template_id,
|
||||
'data' => $this->get_props_data(),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter icon type properties
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $props Icon type properties.
|
||||
* @param string $id Icon type ID.
|
||||
* @param Icon_Picker_Type $type Icon_Picker_Type object.
|
||||
*/
|
||||
$props = apply_filters( 'icon_picker_type_props', $props, $this->id, $this );
|
||||
|
||||
/**
|
||||
* Filter icon type properties
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $props Icon type properties.
|
||||
* @param Icon_Picker_Type $type Icon_Picker_Type object.
|
||||
*/
|
||||
$props = apply_filters( "icon_picker_type_props_{$this->id}", $props, $this );
|
||||
|
||||
return $props;
|
||||
}
|
||||
}
|
1229
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/dashicons.php
vendored
Normal file
1229
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/dashicons.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1554
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/elusive.php
vendored
Normal file
1554
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/elusive.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3676
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/fa.php
vendored
Normal file
3676
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/fa.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
205
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/font.php
vendored
Normal file
205
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/font.php
vendored
Normal file
@ -0,0 +1,205 @@
|
||||
<?php
|
||||
/**
|
||||
* Base font icon handler
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
|
||||
/**
|
||||
* Generic handler for icon fonts
|
||||
*
|
||||
*/
|
||||
abstract class Icon_Picker_Type_Font extends Icon_Picker_Type {
|
||||
|
||||
/**
|
||||
* Stylesheet ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $stylesheet_id = '';
|
||||
|
||||
/**
|
||||
* JS Controller
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $controller = 'Font';
|
||||
|
||||
/**
|
||||
* Template ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $template_id = 'font';
|
||||
|
||||
|
||||
/**
|
||||
* Get icon groups
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_groups() {}
|
||||
|
||||
|
||||
/**
|
||||
* Get icon names
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_items() {}
|
||||
|
||||
|
||||
/**
|
||||
* Get stylesheet URI
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_stylesheet_uri() {
|
||||
$stylesheet_uri = sprintf(
|
||||
'%1$s/css/types/%2$s%3$s.css',
|
||||
Icon_Picker::instance()->url,
|
||||
$this->stylesheet_id,
|
||||
( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'
|
||||
);
|
||||
|
||||
/**
|
||||
* Filters icon type's stylesheet URI
|
||||
*
|
||||
* @since 0.4.0
|
||||
*
|
||||
* @param string $stylesheet_uri Icon type's stylesheet URI.
|
||||
* @param string $icon_type_id Icon type's ID.
|
||||
* @param Icon_Picker_Type_Font $icon_type Icon type's instance.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
$stylesheet_uri = apply_filters(
|
||||
'icon_picker_icon_type_stylesheet_uri',
|
||||
$stylesheet_uri,
|
||||
$this->id,
|
||||
$this
|
||||
);
|
||||
|
||||
return $stylesheet_uri;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register assets
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @wp_hook action icon_picker_loader_init
|
||||
*
|
||||
* @param Icon_Picker_Loader $loader Icon_Picker_Loader instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register_assets( Icon_Picker_Loader $loader ) {
|
||||
if ( empty( $this->stylesheet_uri ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$register = true;
|
||||
$deps = false;
|
||||
$styles = wp_styles();
|
||||
|
||||
/**
|
||||
* When the stylesheet ID of an icon type is already registered,
|
||||
* we'll compare its version with ours. If our stylesheet has greater
|
||||
* version number, we'll deregister the other stylesheet.
|
||||
*/
|
||||
if ( $styles->query( $this->stylesheet_id, 'registered' ) ) {
|
||||
$object = $styles->registered[ $this->stylesheet_id ];
|
||||
|
||||
if ( version_compare( $object->ver, $this->version, '<' ) ) {
|
||||
$deps = $object->deps;
|
||||
wp_deregister_style( $this->stylesheet_id );
|
||||
} else {
|
||||
$register = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $register ) {
|
||||
wp_register_style( $this->stylesheet_id, $this->stylesheet_uri, $deps, $this->version );
|
||||
}
|
||||
|
||||
$loader->add_style( $this->stylesheet_id );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $args Optional arguments passed to parent class.
|
||||
*/
|
||||
public function __construct( array $args = array() ) {
|
||||
parent::__construct( $args );
|
||||
|
||||
if ( empty( $this->stylesheet_id ) ) {
|
||||
$this->stylesheet_id = $this->id;
|
||||
}
|
||||
|
||||
add_action( 'icon_picker_loader_init', array( $this, 'register_assets' ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get extra properties data
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function get_props_data() {
|
||||
return array(
|
||||
'groups' => $this->groups,
|
||||
'items' => $this->items,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get media templates
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_templates() {
|
||||
$templates = array(
|
||||
'icon' => '<i class="_icon {{data.type}} {{ data.icon }}"></i>',
|
||||
'item' => sprintf(
|
||||
'<div class="attachment-preview js--select-attachment">
|
||||
<div class="thumbnail">
|
||||
<span class="_icon"><i class="{{data.type}} {{ data.id }}"></i></span>
|
||||
<div class="filename"><div>{{ data.name }}</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="check" href="#" title="%s"><div class="media-modal-icon"></div></a>',
|
||||
esc_attr__( 'Deselect', 'icon-picker' )
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter media templates
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $templates Media templates.
|
||||
*/
|
||||
$templates = apply_filters( 'icon_picker_font_media_templates', $templates );
|
||||
|
||||
return $templates;
|
||||
}
|
||||
}
|
55
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/fontello.php
vendored
Normal file
55
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/fontello.php
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Fontello Pack
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
* @author Joshua F. Rountree <joshua@swodev.com>
|
||||
*/
|
||||
|
||||
|
||||
require_once dirname( __FILE__ ) . '/font.php';
|
||||
|
||||
/**
|
||||
* Icon type: Fontello
|
||||
*
|
||||
* @version 0.1.0
|
||||
*/
|
||||
class Icon_Picker_Type_Fontello extends Icon_Picker_Type_Font {
|
||||
|
||||
/**
|
||||
* Stylesheet URI
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $stylesheet_uri;
|
||||
|
||||
/**
|
||||
* Icon pack directory path
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $dir;
|
||||
|
||||
/**
|
||||
* Icon pack directory url
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $url;
|
||||
|
||||
/**
|
||||
* Items
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $items;
|
||||
}
|
1518
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/foundation-icons.php
vendored
Normal file
1518
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/foundation-icons.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
856
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/genericon.php
vendored
Normal file
856
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/genericon.php
vendored
Normal file
@ -0,0 +1,856 @@
|
||||
<?php
|
||||
/**
|
||||
* Genericons
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
class Icon_Picker_Type_Genericons extends Icon_Picker_Type_Font {
|
||||
|
||||
/**
|
||||
* Icon type ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $id = 'genericon';
|
||||
|
||||
/**
|
||||
* Icon type name
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'Genericons';
|
||||
|
||||
/**
|
||||
* Icon type version
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $version = '3.4';
|
||||
|
||||
/**
|
||||
* Stylesheet ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $stylesheet_id = 'genericons';
|
||||
|
||||
|
||||
/**
|
||||
* Get icon groups
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_groups() {
|
||||
$groups = array(
|
||||
array(
|
||||
'id' => 'actions',
|
||||
'name' => __( 'Actions', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'media-player',
|
||||
'name' => __( 'Media Player', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'meta',
|
||||
'name' => __( 'Meta', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'misc',
|
||||
'name' => __( 'Misc.', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'places',
|
||||
'name' => __( 'Places', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'post-formats',
|
||||
'name' => __( 'Post Formats', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'text-editor',
|
||||
'name' => __( 'Text Editor', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'social',
|
||||
'name' => __( 'Social', 'icon-picker' ),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter genericon groups
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $groups Icon groups.
|
||||
*/
|
||||
$groups = apply_filters( 'icon_picker_genericon_groups', $groups );
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get icon names
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_items() {
|
||||
$items = array(
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-checkmark',
|
||||
'name' => __( 'Checkmark', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-close',
|
||||
'name' => __( 'Close', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-close-alt',
|
||||
'name' => __( 'Close', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-dropdown',
|
||||
'name' => __( 'Dropdown', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-dropdown-left',
|
||||
'name' => __( 'Dropdown left', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-collapse',
|
||||
'name' => __( 'Collapse', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-expand',
|
||||
'name' => __( 'Expand', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-help',
|
||||
'name' => __( 'Help', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-info',
|
||||
'name' => __( 'Info', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-lock',
|
||||
'name' => __( 'Lock', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-maximize',
|
||||
'name' => __( 'Maximize', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-minimize',
|
||||
'name' => __( 'Minimize', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-plus',
|
||||
'name' => __( 'Plus', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-minus',
|
||||
'name' => __( 'Minus', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-previous',
|
||||
'name' => __( 'Previous', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-next',
|
||||
'name' => __( 'Next', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-move',
|
||||
'name' => __( 'Move', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-hide',
|
||||
'name' => __( 'Hide', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-show',
|
||||
'name' => __( 'Show', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-print',
|
||||
'name' => __( 'Print', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-rating-empty',
|
||||
'name' => __( 'Rating: Empty', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-rating-half',
|
||||
'name' => __( 'Rating: Half', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-rating-full',
|
||||
'name' => __( 'Rating: Full', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-refresh',
|
||||
'name' => __( 'Refresh', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-reply',
|
||||
'name' => __( 'Reply', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-reply-alt',
|
||||
'name' => __( 'Reply alt', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-reply-single',
|
||||
'name' => __( 'Reply single', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-search',
|
||||
'name' => __( 'Search', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-send-to-phone',
|
||||
'name' => __( 'Send to', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-send-to-tablet',
|
||||
'name' => __( 'Send to', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-share',
|
||||
'name' => __( 'Share', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-shuffle',
|
||||
'name' => __( 'Shuffle', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-spam',
|
||||
'name' => __( 'Spam', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-subscribe',
|
||||
'name' => __( 'Subscribe', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-subscribed',
|
||||
'name' => __( 'Subscribed', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-unsubscribe',
|
||||
'name' => __( 'Unsubscribe', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-top',
|
||||
'name' => __( 'Top', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-unapprove',
|
||||
'name' => __( 'Unapprove', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-zoom',
|
||||
'name' => __( 'Zoom', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-unzoom',
|
||||
'name' => __( 'Unzoom', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'actions',
|
||||
'id' => 'genericon-xpost',
|
||||
'name' => __( 'X-Post', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'media-player',
|
||||
'id' => 'genericon-skip-back',
|
||||
'name' => __( 'Skip back', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'media-player',
|
||||
'id' => 'genericon-rewind',
|
||||
'name' => __( 'Rewind', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'media-player',
|
||||
'id' => 'genericon-play',
|
||||
'name' => __( 'Play', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'media-player',
|
||||
'id' => 'genericon-pause',
|
||||
'name' => __( 'Pause', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'media-player',
|
||||
'id' => 'genericon-stop',
|
||||
'name' => __( 'Stop', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'media-player',
|
||||
'id' => 'genericon-fastforward',
|
||||
'name' => __( 'Fast Forward', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'media-player',
|
||||
'id' => 'genericon-skip-ahead',
|
||||
'name' => __( 'Skip ahead', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-comment',
|
||||
'name' => __( 'Comment', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-category',
|
||||
'name' => __( 'Category', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-hierarchy',
|
||||
'name' => __( 'Hierarchy', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-tag',
|
||||
'name' => __( 'Tag', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-time',
|
||||
'name' => __( 'Time', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-user',
|
||||
'name' => __( 'User', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-day',
|
||||
'name' => __( 'Day', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-week',
|
||||
'name' => __( 'Week', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-month',
|
||||
'name' => __( 'Month', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'meta',
|
||||
'id' => 'genericon-pinned',
|
||||
'name' => __( 'Pinned', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-uparrow',
|
||||
'name' => __( 'Arrow Up', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-downarrow',
|
||||
'name' => __( 'Arrow Down', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-leftarrow',
|
||||
'name' => __( 'Arrow Left', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-rightarrow',
|
||||
'name' => __( 'Arrow Right', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-activity',
|
||||
'name' => __( 'Activity', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-bug',
|
||||
'name' => __( 'Bug', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-book',
|
||||
'name' => __( 'Book', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-cart',
|
||||
'name' => __( 'Cart', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-cloud-download',
|
||||
'name' => __( 'Cloud Download', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-cloud-upload',
|
||||
'name' => __( 'Cloud Upload', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-cog',
|
||||
'name' => __( 'Cog', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-document',
|
||||
'name' => __( 'Document', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-dot',
|
||||
'name' => __( 'Dot', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-download',
|
||||
'name' => __( 'Download', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-draggable',
|
||||
'name' => __( 'Draggable', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-ellipsis',
|
||||
'name' => __( 'Ellipsis', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-external',
|
||||
'name' => __( 'External', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-feed',
|
||||
'name' => __( 'Feed', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-flag',
|
||||
'name' => __( 'Flag', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-fullscreen',
|
||||
'name' => __( 'Fullscreen', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-handset',
|
||||
'name' => __( 'Handset', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-heart',
|
||||
'name' => __( 'Heart', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-key',
|
||||
'name' => __( 'Key', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-mail',
|
||||
'name' => __( 'Mail', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-menu',
|
||||
'name' => __( 'Menu', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-microphone',
|
||||
'name' => __( 'Microphone', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-notice',
|
||||
'name' => __( 'Notice', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-paintbrush',
|
||||
'name' => __( 'Paint Brush', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-phone',
|
||||
'name' => __( 'Phone', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-picture',
|
||||
'name' => __( 'Picture', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-plugin',
|
||||
'name' => __( 'Plugin', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-portfolio',
|
||||
'name' => __( 'Portfolio', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-star',
|
||||
'name' => __( 'Star', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-summary',
|
||||
'name' => __( 'Summary', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-tablet',
|
||||
'name' => __( 'Tablet', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-videocamera',
|
||||
'name' => __( 'Video Camera', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'misc',
|
||||
'id' => 'genericon-warning',
|
||||
'name' => __( 'Warning', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'places',
|
||||
'id' => 'genericon-404',
|
||||
'name' => __( '404', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'places',
|
||||
'id' => 'genericon-trash',
|
||||
'name' => __( 'Trash', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'places',
|
||||
'id' => 'genericon-cloud',
|
||||
'name' => __( 'Cloud', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'places',
|
||||
'id' => 'genericon-home',
|
||||
'name' => __( 'Home', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'places',
|
||||
'id' => 'genericon-location',
|
||||
'name' => __( 'Location', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'places',
|
||||
'id' => 'genericon-sitemap',
|
||||
'name' => __( 'Sitemap', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'places',
|
||||
'id' => 'genericon-website',
|
||||
'name' => __( 'Website', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-standard',
|
||||
'name' => __( 'Standard', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-aside',
|
||||
'name' => __( 'Aside', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-image',
|
||||
'name' => __( 'Image', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-gallery',
|
||||
'name' => __( 'Gallery', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-video',
|
||||
'name' => __( 'Video', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-status',
|
||||
'name' => __( 'Status', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-quote',
|
||||
'name' => __( 'Quote', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-link',
|
||||
'name' => __( 'Link', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-chat',
|
||||
'name' => __( 'Chat', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'post-formats',
|
||||
'id' => 'genericon-audio',
|
||||
'name' => __( 'Audio', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'text-editor',
|
||||
'id' => 'genericon-anchor',
|
||||
'name' => __( 'Anchor', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'text-editor',
|
||||
'id' => 'genericon-attachment',
|
||||
'name' => __( 'Attachment', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'text-editor',
|
||||
'id' => 'genericon-edit',
|
||||
'name' => __( 'Edit', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'text-editor',
|
||||
'id' => 'genericon-code',
|
||||
'name' => __( 'Code', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'text-editor',
|
||||
'id' => 'genericon-bold',
|
||||
'name' => __( 'Bold', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'text-editor',
|
||||
'id' => 'genericon-italic',
|
||||
'name' => __( 'Italic', 'icon-picker' ),
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-codepen',
|
||||
'name' => 'CodePen',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-digg',
|
||||
'name' => 'Digg',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-dribbble',
|
||||
'name' => 'Dribbble',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-dropbox',
|
||||
'name' => 'DropBox',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-facebook',
|
||||
'name' => 'Facebook',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-facebook-alt',
|
||||
'name' => 'Facebook',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-flickr',
|
||||
'name' => 'Flickr',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-foursquare',
|
||||
'name' => 'Foursquare',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-github',
|
||||
'name' => 'GitHub',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-googleplus',
|
||||
'name' => 'Google+',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-googleplus-alt',
|
||||
'name' => 'Google+',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-instagram',
|
||||
'name' => 'Instagram',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-linkedin',
|
||||
'name' => 'LinkedIn',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-linkedin-alt',
|
||||
'name' => 'LinkedIn',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-path',
|
||||
'name' => 'Path',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-pinterest',
|
||||
'name' => 'Pinterest',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-pinterest-alt',
|
||||
'name' => 'Pinterest',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-pocket',
|
||||
'name' => 'Pocket',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-polldaddy',
|
||||
'name' => 'PollDaddy',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-reddit',
|
||||
'name' => 'Reddit',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-skype',
|
||||
'name' => 'Skype',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-spotify',
|
||||
'name' => 'Spotify',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-stumbleupon',
|
||||
'name' => 'StumbleUpon',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-tumblr',
|
||||
'name' => 'Tumblr',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-twitch',
|
||||
'name' => 'Twitch',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-twitter',
|
||||
'name' => 'Twitter',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-vimeo',
|
||||
'name' => 'Vimeo',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-wordpress',
|
||||
'name' => 'WordPress',
|
||||
),
|
||||
array(
|
||||
'group' => 'social',
|
||||
'id' => 'genericon-youtube',
|
||||
'name' => 'Youtube',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter genericon items
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $items Icon names.
|
||||
*/
|
||||
$items = apply_filters( 'icon_picker_genericon_items', $items );
|
||||
|
||||
return $items;
|
||||
}
|
||||
}
|
126
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/image.php
vendored
Normal file
126
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/image.php
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* Image icon handler
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
|
||||
require_once dirname( __FILE__ ) . '/base.php';
|
||||
|
||||
/**
|
||||
* Image icon
|
||||
*
|
||||
*/
|
||||
class Icon_Picker_Type_Image extends Icon_Picker_Type {
|
||||
|
||||
/**
|
||||
* Icon type ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $id = 'image';
|
||||
|
||||
/**
|
||||
* JS Controller
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $controller = 'Img';
|
||||
|
||||
/**
|
||||
* Template ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $template_id = 'image';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $args Misc. arguments.
|
||||
*/
|
||||
public function __construct( $args = array() ) {
|
||||
if ( empty( $this->name ) ) {
|
||||
$this->name = __( 'Image', 'icon-picker' );
|
||||
}
|
||||
|
||||
parent::__construct( $args );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get extra properties data
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function get_props_data() {
|
||||
return array(
|
||||
'mimeTypes' => $this->get_image_mime_types(),
|
||||
);
|
||||
|
||||
return $props;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get media templates
|
||||
*
|
||||
* @since 0.2.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_templates() {
|
||||
$templates = array(
|
||||
'icon' => '<img src="{{ data.url }}" class="_icon" />',
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter media templates
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $templates Media templates.
|
||||
*/
|
||||
$templates = apply_filters( 'icon_picker_image_media_templates', $templates );
|
||||
|
||||
return $templates;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get image mime types
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
protected function get_image_mime_types() {
|
||||
$mime_types = get_allowed_mime_types();
|
||||
|
||||
foreach ( $mime_types as $id => $type ) {
|
||||
if ( false === strpos( $type, 'image/' ) ) {
|
||||
unset( $mime_types[ $id ] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter image mime types
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $mime_types Image mime types.
|
||||
*/
|
||||
$mime_types = apply_filters( 'icon_picker_image_mime_types', $mime_types );
|
||||
|
||||
// We need to exclude image/svg*.
|
||||
unset( $mime_types['svg'] );
|
||||
|
||||
return $mime_types;
|
||||
}
|
||||
}
|
124
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/svg.php
vendored
Normal file
124
wp-content/plugins/menu-icons/vendor/codeinwp/icon-picker/includes/types/svg.php
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
/**
|
||||
* SVG icon handler
|
||||
*
|
||||
* @package Icon_Picker
|
||||
* @author Dzikri Aziz <kvcrvt@gmail.com>
|
||||
*/
|
||||
|
||||
require_once dirname( __FILE__ ) . '/image.php';
|
||||
|
||||
/**
|
||||
* Image icon
|
||||
*
|
||||
*/
|
||||
class Icon_Picker_Type_Svg extends Icon_Picker_Type_Image {
|
||||
|
||||
/**
|
||||
* Icon type ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $id = 'svg';
|
||||
|
||||
/**
|
||||
* Template ID
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $template_id = 'svg';
|
||||
|
||||
/**
|
||||
* Mime type
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $mime_type = 'image/svg+xml';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $args Misc. arguments.
|
||||
*/
|
||||
public function __construct( $args = array() ) {
|
||||
$this->name = __( 'SVG', 'icon-picker' );
|
||||
|
||||
parent::__construct( $args );
|
||||
add_filter( 'upload_mimes', array( $this, '_add_mime_type' ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add SVG support
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @wp_hook filter upload_mimes
|
||||
* @link https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
|
||||
* @author Ethan Clevenger (GitHub: ethanclevenger91; email: ethan.c.clevenger@gmail.com)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function _add_mime_type( array $mimes ) {
|
||||
if ( ! isset( $mimes['svg'] ) ) {
|
||||
$mimes['svg'] = $this->mime_type;
|
||||
}
|
||||
|
||||
return $mimes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get extra properties data
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function get_props_data() {
|
||||
return array(
|
||||
'mimeTypes' => array( $this->mime_type ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Media templates
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_templates() {
|
||||
$templates = array(
|
||||
'icon' => '<img src="{{ data.url }}" class="_icon" />',
|
||||
'item' => sprintf(
|
||||
'<div class="attachment-preview js--select-attachment svg-icon">
|
||||
<div class="thumbnail">
|
||||
<div class="centered">
|
||||
<img src="{{ data.url }}" alt="{{ data.alt }}" class="_icon _{{data.type}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="check" href="#" title="%s"><div class="media-modal-icon"></div></a>',
|
||||
esc_attr__( 'Deselect', 'menu-icons' )
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter media templates
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @param array $templates Media templates.
|
||||
*/
|
||||
$templates = apply_filters( 'icon_picker_svg_media_templates', $templates );
|
||||
|
||||
return $templates;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user