<?php
/**
* Enqueue styles & scripts
*
* @package Bootscore
* @version 6.5.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
/**
* Enqueue scripts and styles
*/
function bootscore_scripts() {
// Get modification time. Enqueue files with modification date to prevent browser from loading cached scripts and styles when file content changes.
$modificated_bootscoreCss = (file_exists(get_template_directory() . '/assets/css/main.css')) ? date('YmdHi', filemtime(get_template_directory() . '/assets/css/main.css')) : 1;
$modificated_styleCss = date('YmdHi', filemtime(get_stylesheet_directory() . '/style.css'));
$modificated_fontawesomeCss = date('YmdHi', filemtime(get_template_directory() . '/assets/fontawesome/css/all.min.css'));
$modificated_bootstrapJs = date('YmdHi', filemtime(get_template_directory() . '/assets/js/lib/bootstrap.bundle.min.js'));
$modificated_themeJs = date('YmdHi', filemtime(get_template_directory() . '/assets/js/theme.js'));
// Bootscore
$bootscore_disable_compiler = apply_filters('bootscore/scss/disable_compiler', (defined('BOOTSCORE_SCSS_DISABLE_COMPILER') && BOOTSCORE_SCSS_DISABLE_COMPILER));
if ( ! $bootscore_disable_compiler ) {
require_once 'scss-compiler.php';
bootscore_compile_scss();
}
wp_enqueue_style('main', get_template_directory_uri() . '/assets/css/main.css', array(), $modificated_bootscoreCss);
// Style CSS
wp_enqueue_style('bootscore-style', get_stylesheet_uri(), array(), $modificated_styleCss);
// Fontawesome
if (apply_filters('bootscore/load_fontawesome', true)) {
wp_enqueue_style('fontawesome', get_template_directory_uri() . '/assets/fontawesome/css/all.min.css', array(), $modificated_fontawesomeCss);
}
// Bootstrap JS
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/lib/bootstrap.bundle.min.js', array(), $modificated_bootstrapJs, true);
// Theme JS
wp_enqueue_script('bootscore-script', get_template_directory_uri() . '/assets/js/theme.js', array('jquery'), $modificated_themeJs, true);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'bootscore_scripts');
/**
* Register editor styles.
*/
function bootscore_add_editor_styles() {
// Add support for editor styles and main.css for the editor
add_theme_support('editor-styles');
add_editor_style('assets/css/main.css');
}
add_action('after_setup_theme', 'bootscore_add_editor_styles');
/**
* Enqueue styles for block editor and Pattern Library.
*/
function bootscore_enqueue_editor_and_pattern_library_styles($hook_suffix) {
$screen = get_current_screen();
// Enqueue editor.css only in the block editor
if ($screen && $screen->is_block_editor) {
wp_enqueue_style('editor-style', get_stylesheet_directory_uri() . '/assets/css/editor.css');
}
// Enqueue main.css only in the Pattern Library
if ('appearance_page_edit-wp-patterns' === $hook_suffix) {
wp_enqueue_style('bootscore-pattern-library-styles', get_stylesheet_directory_uri() . '/assets/css/main.css');
}
}
add_action('admin_enqueue_scripts', 'bootscore_enqueue_editor_and_pattern_library_styles');
/**
* Preload Font Awesome stylesheet
*/
function bootscore_fa_preload( $html, $handle, $href, $media ) {
if ( 'fontawesome' !== $handle ) {
return $html;
}
return sprintf(
'<link rel="preload" href="%1$s" as="style" onload="this.onload=null;this.rel=\'stylesheet\'">' .
'<noscript><link rel="stylesheet" href="%1$s"></noscript>',
esc_url( $href )
);
}
add_filter( 'style_loader_tag', 'bootscore_fa_preload', 10, 4 );
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| blocks/ | 2026-11-26 08:19 | 19.5 KB | 76129f60960:kunden | dxwrx-rx-r | |
| scssphp/ | 2026-11-26 08:19 | 549.31 KB | 76129f60960:kunden | dxwrx-rx-r | |
| update/ | 2026-11-26 08:19 | 380.49 KB | 76129f60960:kunden | dxwrx-rx-r | |
| updater/ | 2026-11-26 08:19 | 25.44 KB | 76129f60960:kunden | dxwrx-rx-r | |
| breadcrumb.php | 2026-11-26 08:19 | 6.2 KB | 76129f60960:kunden | -xw-x--x-- | |
| columns.php | 2026-11-26 08:19 | 703 B | 76129f60960:kunden | -xw-x--x-- | |
| comments.php | 2026-11-26 08:19 | 5.27 KB | 76129f60960:kunden | -xw-x--x-- | |
| deprecated.php | 2026-11-26 08:19 | 132 B | 76129f60960:kunden | -xw-x--x-- | |
| enable-html.php | 2026-11-26 08:19 | 642 B | 76129f60960:kunden | -xw-x--x-- | |
| enqueue.php | 2026-11-26 08:19 | 3.59 KB | 76129f60960:kunden | -xw-x--x-- | |
| excerpt.php | 2026-11-26 08:19 | 200 B | 76129f60960:kunden | -xw-x--x-- | |
| fontawesome.php | 2026-11-26 08:19 | 1.02 KB | 76129f60960:kunden | -xw-x--x-- | |
| jetpack.php | 2026-11-26 08:19 | 1.47 KB | 76129f60960:kunden | -xw-x--x-- | |
| navmenu.php | 2026-11-26 08:19 | 681 B | 76129f60960:kunden | -xw-x--x-- | |
| navwalker.php | 2026-11-26 08:19 | 6.97 KB | 76129f60960:kunden | -xw-x--x-- | |
| pagination.php | 2026-11-26 08:19 | 3.01 KB | 76129f60960:kunden | -xw-x--x-- | |
| password-protected-form.php | 2026-11-26 08:19 | 864 B | 76129f60960:kunden | -xw-x--x-- | |
| scss-compiler.php | 2026-11-26 08:19 | 7.26 KB | 76129f60960:kunden | -xw-x--x-- | |
| template-functions.php | 2026-11-26 08:19 | 1005 B | 76129f60960:kunden | -xw-x--x-- | |
| template-tags.php | 2026-11-26 08:19 | 8.87 KB | 76129f60960:kunden | -xw-x--x-- | |
| theme-setup.php | 2026-11-26 08:19 | 2.71 KB | 76129f60960:kunden | -xw-x--x-- | |
| tinymce-editor.php | 2026-11-26 08:19 | 841 B | 76129f60960:kunden | -xw-x--x-- | |
| widgets.php | 2026-11-26 08:19 | 5.97 KB | 76129f60960:kunden | -xw-x--x-- | |