version ); } return $stylesheet_uri; } /** * Icon picker fontawesome items. * * @param array $icons Icons. * @return array Icons. */ public static function _icon_picker_fa_items( $icons ) { if ( empty( $icons ) ) { return $icons; } $deprecated_icons = array_search( 'fa-tripadvisor', array_column( $icons, 'id' ), true ); if ( false !== $deprecated_icons ) { unset( $icons[ $deprecated_icons ] ); $icons = array_values( $icons ); } $font_awesome = font_awesome_backward_compatible(); foreach ( $icons as $key => $icon ) { $old_fa_icon = sprintf( 'fa-%s', $icons[ $key ]['id'] ); if ( array_key_exists( $old_fa_icon, $font_awesome ) ) { $icons[ $key ]['id'] = trim( $font_awesome[ $old_fa_icon ] ); } else { $icons[ $key ]['id'] = sprintf( 'fa %s', trim( $icons[ $key ]['id'] ) ); } } // Fa5 extra icons support. $global_settins = get_option( 'menu-icons', false ); if ( ! empty( $global_settins['global']['fa5_extra_icons'] ) ) { $fa5_extra_icons = $global_settins['global']['fa5_extra_icons']; $fa5_extra_icons = explode( ',', $fa5_extra_icons ); $fa5_extra_icons = array_map( 'trim', $fa5_extra_icons ); if ( ! empty( $fa5_extra_icons ) ) { foreach ( $fa5_extra_icons as $fa5_icon ) { $icon_name = explode( '-', $fa5_icon ); $icon_name = end( $icon_name ); $icons[] = array( 'group' => 'all', 'id' => $fa5_icon, 'name' => $icon_name, ); } } } return $icons; } /** * Icon picker font media template. * * @param string $template Media template. * @return string Media template. */ public static function _icon_picker_font_media_templates( $template ) { $templates = array( 'icon' => '', 'item' => sprintf( '
', esc_attr__( 'Deselect', 'icon-picker' ) ), ); return $templates; } }