mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- changed form builder > icon field to new dropdown type;
This commit is contained in:
@@ -352,5 +352,49 @@ KEY meta_value_indx (um_value(191))
|
||||
update_user_meta( $user_id, 'account_status', 'approved' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function set_icons_options() {
|
||||
$fa_version = get_option( 'um_fa_version' );
|
||||
$um_icons_list = get_option( 'um_icons_list' );
|
||||
|
||||
if ( empty( $um_icons_list ) || UM()->admin()->enqueue()::$fa_version !== $fa_version ) {
|
||||
update_option( 'um_fa_version', UM()->admin()->enqueue()::$fa_version, false );
|
||||
|
||||
$common_icons = array();
|
||||
|
||||
$icons = file_get_contents( UM_PATH . 'assets/libs/fontawesome/metadata/icons.json' );
|
||||
$icons = json_decode( $icons );
|
||||
|
||||
foreach ( $icons as $key => $data ) {
|
||||
if ( ! isset( $data->styles ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ( $data->styles as $style ) {
|
||||
$style_class = '';
|
||||
if ( 'solid' === $style ) {
|
||||
$style_class = 'fas fa-';
|
||||
} elseif ( 'regular' === $style ) {
|
||||
$style_class = 'far fa-';
|
||||
} elseif ( 'brands' === $style ) {
|
||||
$style_class = 'fab fa-';
|
||||
}
|
||||
|
||||
$label = count( $data->styles ) > 1 ? $data->label . ' (' . $style . ')' : $data->label;
|
||||
$search = array_unique( array_merge( $data->search->terms, array( $key, strtolower( $data->label ) ) ) );
|
||||
|
||||
$common_icons[ $style_class . $key ] = array(
|
||||
'label' => $label,
|
||||
'search' => $search,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
update_option( 'um_icons_list', $common_icons, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user