/** * Filter the 'stylesheet_uri' to load a minified version of 'style.css' * file if it is available. * * @since 1.0.0 * @access public * @param string $stylesheet_uri The URI of the active theme's stylesheet. * @param string $stylesheet_dir_uri The directory URI of the active theme's stylesheet. * @return string $stylesheet_uri */ function carelib_min_stylesheet_uri($stylesheet_uri, $stylesheet_dir_uri) { $suffix = carelib_get_suffix(); if (!$suffix) { return $stylesheet_uri; } // Remove the stylesheet directory URI from the file name. $stylesheet = str_replace(trailingslashit($stylesheet_dir_uri), '', $stylesheet_uri); // Change the stylesheet name to 'style.min.css'. $stylesheet = str_replace('.css', "{$suffix}.css", $stylesheet); if (file_exists(carelib_get_child_dir() . $stylesheet)) { $stylesheet_uri = esc_url(trailingslashit($stylesheet_dir_uri) . $stylesheet); } return $stylesheet_uri; }
/** * Registers admin styles. * * @since 1.0.0 * @access public * @return void */ function carelib_admin_register_scripts() { $suffix = carelib_get_suffix(); wp_register_script('carelib-dashboard', carelib_get_js_uri("carelib-dashboard{$suffix}.js"), array('jquery-ui-tabs'), CARELIB_VERSION, true); }
/** * Register customizer preview scripts. * * @since 1.0.0 * @access public * @return void */ function carelib_customize_register_preview_scripts() { $suffix = carelib_get_suffix(); wp_register_script('carelib-customize-preview', carelib_get_js_uri("customize-preview{$suffix}.js"), array('jquery'), CARELIB_VERSION, true); }
/** * Registers admin styles. * * @since 1.0.0 * @access public * @return void */ function carelib_admin_register_styles() { $suffix = carelib_get_suffix(); wp_register_style('carelib-admin', carelib_get_css_uri("carelib-admin{$suffix}.css"), null, CARELIB_VERSION); wp_register_style('carelib-dashboard', carelib_get_css_uri("carelib-dashboard{$suffix}.css"), null, CARELIB_VERSION); }
/** * Register customizer controls styles. * * @since 1.0.0 * @access public * @return void */ function carelib_customize_register_controls_styles() { $suffix = carelib_get_suffix(); wp_register_style('carelib-customize-controls', carelib_get_css_uri("customize-controls{$suffix}.css"), array(), CARELIB_VERSION); }