Enqueue a UIkit theme.
The theme must not contain sub-folders. Component files in the theme will be automatically combined to the UIkit compiler if that component is used.
This function must be called in the ‘beans_uikit_enqueue_scripts’ action hook.
beans_uikit_enqueue_theme( string $id, string $path = false )
Return: (bool) False on error, true on success.
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
$id | string | true | - | A unique string used as a reference. Similar to the WordPress scripts $handle argument. |
$path | string | false | false | Path to the UIkit theme folder if the theme isn't yet registered. |
Source
function beans_uikit_enqueue_theme( $id, $path = false ) {
// Make sure it is registered, if not, try to do so.
if ( ! beans_uikit_register_theme( $id, $path ) ) {
return false;
}
global $_beans_uikit_enqueued_items;
$_beans_uikit_enqueued_items['themes'][ $id ] = _beans_uikit_get_registered_theme( $id );
return true;
}