本文整理汇总了PHP中wp_enqueue_style函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_enqueue_style函数的具体用法?PHP wp_enqueue_style怎么用?PHP wp_enqueue_style使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_enqueue_style函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup_wizard
/**
* Show the setup wizard
*/
public function setup_wizard()
{
if (empty($_GET['page']) || 'wc-setup' !== $_GET['page']) {
return;
}
$this->steps = array('introduction' => array('name' => __('Introduction', 'woocommerce'), 'view' => array($this, 'wc_setup_introduction'), 'handler' => ''), 'pages' => array('name' => __('Page Setup', 'woocommerce'), 'view' => array($this, 'wc_setup_pages'), 'handler' => array($this, 'wc_setup_pages_save')), 'locale' => array('name' => __('Store Locale', 'woocommerce'), 'view' => array($this, 'wc_setup_locale'), 'handler' => array($this, 'wc_setup_locale_save')), 'shipping_taxes' => array('name' => __('Shipping & Tax', 'woocommerce'), 'view' => array($this, 'wc_setup_shipping_taxes'), 'handler' => array($this, 'wc_setup_shipping_taxes_save')), 'payments' => array('name' => __('Payments', 'woocommerce'), 'view' => array($this, 'wc_setup_payments'), 'handler' => array($this, 'wc_setup_payments_save')), 'next_steps' => array('name' => __('Ready!', 'woocommerce'), 'view' => array($this, 'wc_setup_ready'), 'handler' => ''));
$this->step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps));
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_register_script('select2', WC()->plugin_url() . '/assets/js/select2/select2' . $suffix . '.js', array('jquery'), '3.5.2');
wp_register_script('wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array('jquery', 'select2'), WC_VERSION);
wp_localize_script('wc-enhanced-select', 'wc_enhanced_select_params', array('i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'woocommerce'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'woocommerce'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'woocommerce'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'woocommerce'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'woocommerce'), 'ajax_url' => admin_url('admin-ajax.php'), 'search_products_nonce' => wp_create_nonce('search-products'), 'search_customers_nonce' => wp_create_nonce('search-customers')));
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION);
wp_enqueue_style('wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array('dashicons', 'install'), WC_VERSION);
wp_register_script('wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup.min.js', array('jquery', 'wc-enhanced-select'), WC_VERSION);
wp_localize_script('wc-setup', 'wc_setup_params', array('locale_info' => json_encode(include WC()->plugin_path() . '/i18n/locale-info.php')));
if (!empty($_POST['save_step']) && isset($this->steps[$this->step]['handler'])) {
call_user_func($this->steps[$this->step]['handler']);
}
ob_start();
$this->setup_wizard_header();
$this->setup_wizard_steps();
$this->setup_wizard_content();
$this->setup_wizard_footer();
exit;
}
示例2: mb_scripts
/**
* Enqueue scripts
*/
function mb_scripts()
{
wp_enqueue_style('_mbbasetheme-style', get_stylesheet_uri());
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
示例3: admin_enqueue_scripts
function admin_enqueue_scripts()
{
// scripts
wp_enqueue_script('acf-input');
// styles
wp_enqueue_style('acf-input');
}
示例4: includeLoginFiles
function includeLoginFiles()
{
wp_register_style('custom_wp_login_css', get_bloginfo('stylesheet_directory') . '/css/login.css', false, '1.0.0');
wp_enqueue_style('custom_wp_login_css');
wp_register_script('custom_wp_login_js', get_bloginfo('stylesheet_directory') . '/js/login.js', false, '1.0.0');
wp_enqueue_script('custom_wp_login_js');
}
示例5: _enqueue_static
/**
* @internal
* {@inheritdoc}
*/
protected function _enqueue_static($id, $option, $data)
{
wp_enqueue_style('fw-option-' . $this->get_type(), fw_get_framework_directory_uri('/includes/option-types/' . $this->get_type() . '/static/css/styles.css'), array(), fw()->manifest->get_version());
wp_enqueue_script('fw-option-' . $this->get_type(), fw_get_framework_directory_uri('/includes/option-types/' . $this->get_type() . '/static/js/scripts.js'), array('fw-events', 'jquery-ui-sortable'), fw()->manifest->get_version(), true);
fw()->backend->enqueue_options_static($option['box-options']);
return true;
}
示例6: fast_scripts
/**
* Enqueue scripts and styles for the theme.
*/
function fast_scripts()
{
//LOAD style.css via filesystem. Uses Sass to ompile '/assets/scss/style.scss' to: 'styl.css'
wp_enqueue_style('fast-sass', get_stylesheet_uri(), array(), '1.0.0');
//LOAD jQuery.min.js via CDN JS
wp_enqueue_script('fast-jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js', array(), '1.0.0', true);
//LOAD Boostrap.min.js via CDN JS
wp_enqueue_script('fast-bootstrap', 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js', array(), '1.0.0', true);
//LOAD navigation.js via filesystem
wp_enqueue_script('fast-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '1.0.0', true);
//LOAD fast-skip-link-focus.js via filesystem
//wp_enqueue_script( 'fast-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '1.0.0', true );
//LOAD instantclick.js via CDN JS
wp_enqueue_script('fast-instantclick', 'https://cdnjs.cloudflare.com/ajax/libs/instantclick/3.0.1/instantclick.min.js', array(), '1.0.0', true);
//CALL instant click into end of footer scripts, for init
function call_instant_click()
{
echo '<script data-no-instant>InstantClick.init();</script>';
}
add_action('wp_footer', 'call_instant_click', 200);
//load at end
//IF IS singlular & comments are enabled, load comment-reply.js via filesystem
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
示例7: wplms_dashboard_template
function wplms_dashboard_template()
{
if (!is_user_logged_in()) {
wp_redirect(site_url());
}
$template = 'templates/dashboard';
global $bp;
if ($bp->current_component == 'dashboard') {
wp_enqueue_style('wplms-dashboard-css', WPLMS_DASHBOARD_URL . '/css/wplms-dashboard.css', array(), '1.0');
wp_enqueue_script('wplms-dashboard-js', WPLMS_DASHBOARD_URL . '/js/wplms-dashboard.js', array('jquery', 'jquery-ui-sortable'), '1.0');
if (is_active_widget(false, false, 'wplms_instructor_dash_stats', true) || is_active_widget(false, false, 'wplms_dash_stats', true)) {
wp_enqueue_script('wplms-sparkline', WPLMS_DASHBOARD_URL . '/js/jquery.sparkline.min.js', array('jquery'), true);
}
if (is_active_widget(false, false, 'wplms_instructor_stats', true) || is_active_widget(false, false, 'wplms_instructor_commission_stats', true) || is_active_widget(false, false, 'wplms_student_stats', true)) {
wp_enqueue_script('wplms-raphael', WPLMS_DASHBOARD_URL . '/js/raphael-min.js', array('jquery'), true);
wp_enqueue_script('wplms-morris', WPLMS_DASHBOARD_URL . '/js/morris.min.js', array('jquery'), true);
}
$translation_array = array('earnings' => __('Earnings', 'wplms-dashboard'), 'payout' => __('Payout', 'wplms-dashboard'), 'students' => __('# Students', 'wplms-dashboard'), 'saved' => __('SAVED', 'wplms-dashboard'), 'saving' => __('SAVING ...', 'wplms-dashboard'), 'stats_calculated' => __('Stats Calculated, reloading page ...', 'wplms-dashboard'));
wp_localize_script('wplms-dashboard-js', 'wplms_dashboard_strings', $translation_array);
}
$located_template = apply_filters('bp_located_template', locate_template($template, false), $template);
if ($located_template && $located_template != '') {
bp_get_template_part(apply_filters('bp_load_template', $located_template));
} else {
bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/dashboard'));
}
}
示例8: understrap_scripts
/**
* understrap enqueue scripts
*
* @package understrap
*/
function understrap_scripts()
{
// wp_enqueue_style( 'understrap-theme', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), '0.2.8', false );
wp_enqueue_style('understrap-theme', get_stylesheet_directory_uri() . '/css/theme.css', array(), '0.2.8', false);
// wp_enqueue_script('jquery');
wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery.js', array(), '2.1.4', false);
wp_enqueue_script('understrap-navigation', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '20120206', true);
wp_enqueue_script('understrap-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);
// angular relations
wp_enqueue_script('angular', get_template_directory_uri() . '/js/angular.js', array(), '1.4.9', true);
wp_enqueue_script('angular-ui-router', '//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.17/angular-ui-router.min.js', array(), '0.2.17', true);
wp_enqueue_script('angular-animate', '//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-animate.js', array(), '1.4.9', true);
wp_enqueue_script('angular-sanitize', '//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-sanitize.min.js', array(), '1.4.9', true);
wp_enqueue_script('ui-bootstrap', '//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.1.2.js', array(), '1.1.2', true);
// Angualr APP
wp_enqueue_script('app', get_template_directory_uri() . '/js/app.js', array(), null, true);
// Custom JS
wp_enqueue_script('script', get_template_directory_uri() . '/js/script.js', array(), null, true);
// NON SASS CSS
wp_enqueue_style('animate', get_stylesheet_directory_uri() . '/css/animate.css', array(), '0.2.8', false);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
if (is_active_sidebar('hero')) {
wp_enqueue_style('understrap-carousel-style', get_template_directory_uri() . '/css/owl.carousel.css', array(), '20024', false);
wp_enqueue_script('understrap-carousel-script', get_template_directory_uri() . '/js/owl.carousel.min.js', array(), '20024', true);
}
}
示例9: twentytwelve_custom_header_fonts
/**
* Load our special font CSS file.
*
* @since Twenty Twelve 1.2
*/
function twentytwelve_custom_header_fonts()
{
$font_url = twentytwelve_get_font_url();
if (!empty($font_url)) {
wp_enqueue_style('twentytwelve-fonts', esc_url_raw($font_url), array(), null);
}
}
示例10: enqueue_styles_scripts
/**
* Enqueue styles and scripts
*
* @access public
* @return void
* @since 1.0.0
*/
public function enqueue_styles_scripts()
{
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_register_script('yith_wcas_jquery-autocomplete', YITH_WCAS_URL . 'assets/js/devbridge-jquery-autocomplete' . $suffix . '.js', array('jquery'), '1.2.7', true);
$css = file_exists(get_stylesheet_directory() . '/woocommerce/yith_ajax_search.css') ? get_stylesheet_directory_uri() . '/woocommerce/yith_ajax_search.css' : YITH_WCAS_URL . 'assets/css/yith_wcas_ajax_search.css';
wp_enqueue_style('yith_wcas_frontend', $css);
}
示例11: enqueue_dashboard_stylesheet
function enqueue_dashboard_stylesheet($hook)
{
if ('index.php' != $hook) {
return;
}
wp_enqueue_style('bub_dashboard_widget', pb_backupbuddy::plugin_url() . '/css/dashboard_widget.css');
}
示例12: Attachments
function Attachments()
{
wp_register_script('admin-bar-plugin', $this->pluginUrl . '/js/admin-bar.js', array('jquery-form'));
wp_enqueue_script('admin-bar-plugin');
wp_register_style('admin-bar-plugin', $this->pluginUrl . '/css/admin-bar.css');
wp_enqueue_style('admin-bar-plugin');
}
示例13: add_styles
function add_styles()
{
wp_register_style('userpro_rd_custom', userpro_rd_url . 'admin/css/userpro-redirection.css');
wp_enqueue_style('userpro_rd_custom');
wp_register_script('userpro_rd_custom', userpro_rd_url . 'admin/scripts/userpro-redirection.js');
wp_enqueue_script('userpro_rd_custom');
}
示例14: wl_removeScripts
function wl_removeScripts()
{
//De-Queuing Styles sheet
wp_dequeue_style('default', get_template_directory_uri() . '/css/default.css');
//EN-Queing Style sheet
wp_enqueue_style('lite-brown', get_stylesheet_directory_uri() . '/green.css');
}
示例15: twentythirteen_custom_header_fonts
/**
* Load our special font CSS files.
*
* @since Twenty Thirteen 1.0
*/
function twentythirteen_custom_header_fonts()
{
// Add Source Sans Pro and Bitter fonts.
wp_enqueue_style('twentythirteen-fonts', twentythirteen_fonts_url(), array(), null);
// Add Genericons font.
wp_enqueue_style('genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.03');
}