2

Visual Composer に設定された新しいフォント アイコンを追加しようとしていますが、名前がドロップダウンに表示されています。実際のフォント アイコンのドロップダウンが読み込まれておらず、以下のコードに何が欠けているか、または何が間違っているかわかりません。

どんな助けでも大歓迎です。

// Add new custom font to Font Family selection in icon box module
function reach_add_new_icon_set_to_iconbox( ) {
  $param = WPBMap::getParam( 'vc_icon', 'type' );
  $param['value'][__( 'Reach Icons', 'reach-rdp' )] = 'reach_icons';
  vc_update_shortcode_param( 'vc_icon', $param );
}
add_filter( 'init', 'reach_add_new_icon_set_to_iconbox', 40 );

function reach_add_font_picker() {
  vc_add_param( 'vc_icon', array(
      'type'       => 'iconpicker',
      'heading'    => esc_html__( 'Icon', 'reach-rdp' ),
      'param_name' => 'icons_reach_icons',
      'settings' => array(
          'emptyIcon'    => false,
          'type'         => 'reach_icons',
          'iconsPerPage' => 20,
  ),
      'dependency' => array(
      'element'    => 'icon_type',
      'value'      => 'reach_icons',
  ),
    'group' => esc_html__( 'Icon', 'reach-rdp' ),
  )
  );
}
add_filter( 'vc_after_init', 'reach_add_font_picker', 40 );

function reach_vc_iconpicker_type_reach_icons( $icons ) {
// Add custom icons to array
  $icons['Reach Icons'] = array(
    array( "icon-arrow-left" => "Arrow Left" ),
  );

// Return icons
  return $icons;
}
add_filter( 'vc_iconpicker-type-reach_icons', 'reach_vc_iconpicker_type_reach_icons' );


/**
 * Register Backend and Frontend CSS Styles
 */
add_action( 'vc_base_register_front_css', 'leadinjection_vc_iconpicker_base_register_css' );
add_action( 'vc_base_register_admin_css', 'leadinjection_vc_iconpicker_base_register_css' );
function leadinjection_vc_iconpicker_base_register_css(){
    wp_register_style('reach_icons', get_stylesheet_directory_uri() . '/assets/css/reach-font.css');
}

/**
 * Enqueue Backend and Frontend CSS Styles
 */
add_action( 'vc_backend_editor_enqueue_js_css', 'leadinjection_vc_iconpicker_editor_jscss' );
add_action( 'vc_frontend_editor_enqueue_js_css', 'leadinjection_vc_iconpicker_editor_jscss' );
function leadinjection_vc_iconpicker_editor_jscss(){
    wp_enqueue_style( 'reach_icons' );
}
4

2 に答える 2