This commit is contained in:
Hoang Huu
2019-09-26 13:35:37 +07:00
parent 986fe8e02b
commit 8010b9ca34
14 changed files with 11 additions and 7009 deletions

View File

@@ -11,6 +11,10 @@ if ( ! defined( 'ABSPATH' ) ) {
}
class Opalestate_Field_Iconpicker {
/**
* @var array
*/
protected static $icon_data = [];
/**
* Current version number
@@ -21,11 +25,11 @@ class Opalestate_Field_Iconpicker {
* Initialize the plugin by hooking into CMB2
*/
public static function init() {
// $icons = new Fontawesome();
// $this->icon_data = $icons->get_icons();
$icons = new Fontawesome();
static::$icon_data[] = $icons->get_icons();
add_filter( 'cmb2_render_opal_iconpicker', [ __CLASS__, 'render_iconpicker' ], 10, 5 );
add_filter( 'cmb2_sanitize_opal_iconpicker', [ __CLASS__, 'sanitize_icon' ], 10, 4 );
add_filter( 'cmb2_sanitize_opal_iconpicker', [ __CLASS__, 'sanitize' ], 10, 4 );
}
/**
@@ -56,7 +60,7 @@ class Opalestate_Field_Iconpicker {
/**
* Sanitize data.
*/
public static function sanitize_icon( $override_value, $value, $object_id, $field_args ) {
public static function sanitize( $override_value, $value, $object_id, $field_args ) {
return $value;
}

View File

@@ -11,9 +11,9 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
class Opalestate_Iconpicker_Fontawesome {
const BRANDS_URL = OPALESTATE_PLUGIN_URL . 'assets/3rd/font-awesome/webfonts/fa-brands-400.svg';
const SOLID_URL = OPALESTATE_PLUGIN_URL . 'assets/3rd/font-awesome/webfonts/fa-solid-900.svg';
const REGULAR_URL = OPALESTATE_PLUGIN_URL . 'assets/3rd/font-awesome/webfonts/fa-regular-400.svg';
const BRANDS_URL = OPALESTATE_PLUGIN_URL . 'assets/3rd/fontawesome/webfonts/fa-brands-400.svg';
const SOLID_URL = OPALESTATE_PLUGIN_URL . 'assets/3rd/fontawesome/webfonts/fa-solid-900.svg';
const REGULAR_URL = OPALESTATE_PLUGIN_URL . 'assets/3rd/fontawesome/webfonts/fa-regular-400.svg';
/**
* @var array