本文整理汇总了PHP中wp_style_is函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_style_is函数的具体用法?PHP wp_style_is怎么用?PHP wp_style_is使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_style_is函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: siteorigin_widget_get_icon
/**
* @param $icon_value
* @param bool $icon_styles
*
* @return bool|string
*/
function siteorigin_widget_get_icon($icon_value, $icon_styles = false)
{
if (empty($icon_value)) {
return false;
}
list($family, $icon) = explode('-', $icon_value, 2);
if (empty($family) || empty($icon)) {
return false;
}
static $widget_icon_families;
static $widget_icons_enqueued = array();
if (empty($widget_icon_families)) {
$widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array());
}
if (empty($widget_icon_families[$family]) || empty($widget_icon_families[$family]['icons'][$icon])) {
return false;
}
if (empty($widget_icons_enqueued[$family]) && !empty($widget_icon_families[$family]['style_uri'])) {
if (!wp_style_is('siteorigin-widget-icon-font-' . $family)) {
wp_enqueue_style('siteorigin-widget-icon-font-' . $family, $widget_icon_families[$family]['style_uri']);
}
return '<span class="sow-icon-' . esc_attr($family) . '" data-sow-icon="' . $widget_icon_families[$family]['icons'][$icon] . '" ' . (!empty($icon_styles) ? 'style="' . implode('; ', $icon_styles) . '"' : '') . '></span>';
} else {
return false;
}
}
示例2: cr_styles_scripts
function cr_styles_scripts()
{
if (is_singular('reports')) {
wp_register_style('cap-reports-theme-compat', plugin_dir_url(__FILE__) . 'css/cap-reports-theme-support.css');
wp_register_style('cap-reports-full', plugin_dir_url(__FILE__) . 'css/cap-reports-full.css');
// Check to see if the current theme has support for cap-reports
// This can be delcared on a theme by declaring add_theme_support('cap-reports'); in functions.php
if (current_theme_supports('cap-reports')) {
wp_enqueue_style('cap-reports-theme-compat');
} else {
wp_enqueue_style('cap-reports-full');
}
if (!wp_style_is('mdi', 'enqueued')) {
wp_enqueue_style('mdi', plugin_dir_url(__FILE__) . 'bower_components/mdi/css/materialdesignicons.min.css');
}
// We need to check for enquire js and vide before enqueuing
wp_enqueue_script('cap-reports', plugin_dir_url(__FILE__) . 'js/cap-reports.js', array('jquery'), '20150210', true);
if (!wp_script_is('vide', 'enqueued')) {
wp_enqueue_script('vide', plugin_dir_url(__FILE__) . 'bower_components/vide/dist/jquery.vide.min.js', array('jquery'), '20150210', true);
}
if (!wp_script_is('enquire.js', 'enqueued')) {
wp_enqueue_script('enquire.js', plugin_dir_url(__FILE__) . 'bower_components/enquire/dist/enquire.min.js', array('jquery'), '20150210', true);
}
}
}
示例3: test_it_can_enqueue_style
function test_it_can_enqueue_style()
{
$this->stylesheet->slug = 'foo';
$this->stylesheet->register();
$this->stylesheet->enqueue();
$this->assertTrue(wp_style_is('foo', 'enqueued'));
}
示例4: jetpack_register_social_logos
function jetpack_register_social_logos()
{
if (!wp_style_is('social-logos', 'registered')) {
$post_fix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_register_style('social-logos', plugins_url('social-logos/social-logos' . $post_fix . '.css', __FILE__), false, '1');
}
}
示例5: settings_assets
/**
* Load settings JS & CSS
* @return void
*/
public function settings_assets()
{
// Scripts & Styles for Color Picker
$cpscript = 'farbtastic';
$cpstyle = 'farbtastic';
$list = 'enqueued';
if (wp_script_is($cpscript, $list)) {
return;
} else {
wp_enqueue_script('farbtastic');
}
if (wp_style_is($cpstyle, $list)) {
return;
} else {
wp_enqueue_style('farbtastic');
}
// Custom AMD Scripts
$amdadminjs = 'wfm-admin-js';
if (wp_script_is($amdadminjs, $list)) {
return;
} else {
wp_register_script('wfm-admin-js', $this->plugin_url . '/am-wcslider-admin-scripts.js', array('farbtastic', 'jquery'), '1.0.0');
wp_enqueue_script('wfm-admin-js');
}
}
示例6: zerowp_customizer_enqueue_font
function zerowp_customizer_enqueue_font($option)
{
$font_name = get_theme_mod($option);
if (empty($font_name)) {
$font_name = 'Arial';
}
if (!in_array($font_name, zerowp_customizer_standard_fonts())) {
$font_weight = get_theme_mod($option . '_weight', 400);
$font_weight = !empty($font_weight) ? $font_weight : 400;
$font_weight_in_url = !in_array(absint($font_weight), array(400, 700)) ? '400,700,' . $font_weight : '400,700';
$font_name = trim($font_name);
$handle = 'google_font_' . str_ireplace(' ', '_', $font_name);
if (!wp_style_is($handle, 'enqueued')) {
wp_register_style($handle, "//fonts.googleapis.com/css?family=" . str_ireplace(' ', '+', $font_name) . ":" . $font_weight_in_url);
wp_enqueue_style($handle);
} else {
$registered_link = wp_styles()->query($handle)->src;
if (strpos($registered_link, (string) $font_weight) === false) {
wp_deregister_style($handle);
wp_register_style($handle, $registered_link . ',' . $font_weight);
wp_enqueue_style($handle);
}
}
}
}
示例7: bigboom_enqueue_scripts
/**
* Enqueue scripts and styles.
*
* @since 1.0
*/
function bigboom_enqueue_scripts()
{
/* Register and enqueue styles */
wp_register_style('bb-icons', THEME_URL . '/css/icons.min.css', array(), THEME_VERSION);
wp_register_style('bootstrap', THEME_URL . '/css/bootstrap.min.css', array(), '3.3.2');
wp_register_style('google-fonts', '//fonts.googleapis.com/css?family=Montserrat:400,700|Raleway:300,500,600,700,400');
if (!wp_style_is('js_composer_front', 'enqueued') && wp_style_is('js_composer_front', 'registered')) {
wp_enqueue_style('js_composer_front');
}
wp_enqueue_style('bigboom', get_stylesheet_uri(), array('google-fonts', 'bootstrap', 'bb-icons'), THEME_VERSION);
// Load custom color scheme file
if (intval(bigboom_theme_option('custom_color_scheme')) && bigboom_theme_option('custom_color_1')) {
$upload_dir = wp_upload_dir();
$dir = path_join($upload_dir['baseurl'], 'custom-css');
$file = $dir . '/color-scheme.css';
wp_enqueue_style('bigboom-color-scheme', $file, THEME_VERSION);
}
/** Register and enqueue scripts */
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_register_script('jquery-tabs', THEME_URL . '/js/jquery.tabs.js', array('jquery'), '1.0.0', true);
wp_register_script('bigboom-plugins', THEME_URL . "/js/plugins{$min}.js", array('jquery'), THEME_VERSION, true);
wp_enqueue_script('bigboom', THEME_URL . "/js/scripts{$min}.js", array('bigboom-plugins'), THEME_VERSION, true);
wp_localize_script('bigboom', 'bigboom', array('ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('_bigboom_nonce'), 'direction' => is_rtl() ? 'rtl' : ''));
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
示例8: test_enqueue_scripts_styles
/**
* @since 4.3.0
* @depends test_valid_constructor
*/
public function test_enqueue_scripts_styles()
{
$this->_eeAdminHookMock->enqueue_scripts_styles();
$this->assertTrue(wp_style_is('test-css', 'registered'));
$this->assertTrue(wp_style_is('test-css'));
$this->assertFalse(wp_style_is('event-editor-css', 'registered'));
$this->assertTrue(wp_script_is('test-js', 'registered'));
$this->assertTrue(wp_script_is('test-js'));
//test exception if no registers index in _scripts_styles property.
$scripts_styles_cache = $this->_eeAdminHookMock->get_property('_scripts_styles');
//let's set a scripts styles array with no registers.
$new_scripts_styles['something'] = 'fail';
$this->_eeAdminHookMock->set_property('_scripts_styles', $new_scripts_styles);
$this->setExpectedException('EE_Error');
$this->_eeAdminHookMock->enqueue_scripts_styles();
//test for exception with missing params
$this->_eeAdminHookMock->set_property('_scripts_styles', $scripts_styles_cache);
$new_scripts_styles = $scripts_styles_cache;
unset($new_scripts_styles['registers']['test-css']['url']);
$this->_eeAdminHookMock->set_property('_scripts_styles', $new_scripts_styles);
$this->setExpectedException('EE_Error');
$this->_eeAdminHookMock->enqueue_scripts_styles();
//restore correct scripts styles
$this->_eeAdminHookMock->set_property('_scripts_styles', $scripts_styles_cache);
}
示例9: registration
public function registration($params)
{
// Loading scripts and styles only when required
/* Password Stregth Checker Script */
if (!wp_script_is('form-validate')) {
wp_register_script('form-validate', upme_url . 'js/form-validate.js', array('jquery'));
wp_enqueue_script('form-validate');
$validate_strings = upme_form_validate_setting();
wp_localize_script('form-validate', 'Validate', $validate_strings);
}
// Include password strength meter from WordPress core
wp_enqueue_script('password-strength-meter');
if (!wp_style_is('upme_password_meter')) {
wp_register_style('upme_password_meter', upme_url . 'css/password-meter.css');
wp_enqueue_style('upme_password_meter');
}
if (!wp_style_is('upme_date_picker')) {
wp_register_style('upme_date_picker', upme_url . 'css/upme-datepicker.css');
wp_enqueue_style('upme_date_picker');
}
if (!wp_script_is('upme_date_picker_js')) {
wp_register_script('upme_date_picker_js', upme_url . 'js/upme-datepicker.js', array('jquery'));
wp_enqueue_script('upme_date_picker_js');
// Set date picker default settings
$date_picker_array = upme_date_picker_setting();
wp_localize_script('upme_date_picker_js', 'UPMEDatePicker', $date_picker_array);
}
do_action('upme_add_registration_scripts');
}
示例10: enqueue
public static function enqueue()
{
$image_util_support = get_theme_support('pls-image-util');
if (!wp_script_is('pls-image-util-fancybox', 'registered')) {
wp_register_script('pls-image-util-fancybox', trailingslashit(PLS_EXT_URL) . 'image-util/fancybox/jquery.fancybox-1.3.4.pack.js', array('jquery'), NULL, true);
}
if (!wp_script_is('pls-image-util-fancybox-default-settings', 'registered')) {
wp_register_script('pls-image-util-fancybox-default-settings', trailingslashit(PLS_EXT_URL) . 'image-util/fancybox/default-settings.js', array('jquery'), NULL, true);
}
if (!wp_style_is('pls-image-util-fancybox-style', 'registered')) {
wp_register_style('pls-image-util-fancybox-style', trailingslashit(PLS_EXT_URL) . 'image-util/fancybox/jquery.fancybox-1.3.4.css');
}
if (is_array($image_util_support)) {
if (in_array('fancybox', $image_util_support[0])) {
if (!wp_script_is('pls-image-util-fancybox', 'queue')) {
wp_enqueue_script('pls-image-util-fancybox');
}
if (!wp_script_is('pls-image-util-fancybox-default-settings', 'queue')) {
wp_enqueue_script('pls-image-util-fancybox-default-settings');
}
if (!wp_style_is('pls-image-util-fancybox-style', 'queue')) {
wp_enqueue_style('pls-image-util-fancybox-style');
}
}
return;
}
}
示例11: enqueue_pro_lightbox_resources
function enqueue_pro_lightbox_resources($displayed_gallery = FALSE)
{
$settings = C_NextGen_Settings::get_instance();
if ($settings->thumbEffect == NGG_PRO_LIGHTBOX) {
$router = C_Router::get_instance();
if (!self::$run_once) {
// ensure the gallery exists
if ($displayed_gallery && $displayed_gallery->id()) {
$this->object->_add_script_data('ngg_common', 'galleries.gallery_' . $displayed_gallery->id() . '.wordpress_page_root', get_permalink(), FALSE);
}
wp_enqueue_script('underscore');
wp_enqueue_script('backbone');
wp_enqueue_script('velocity', $router->get_static_url('photocrati-nextgen_pro_lightbox_legacy#velocity.min.js'));
wp_enqueue_script('galleria', $router->get_static_url('photocrati-galleria#galleria-1.4.2.min.js'));
wp_enqueue_style('ngg_pro_lightbox_theme_css', $router->get_static_url('photocrati-nextgen_pro_lightbox_legacy#theme/galleria.nextgen_pro_lightbox.css'));
wp_enqueue_script('ngg_pro_lightbox_theme_js', $router->get_static_url('photocrati-nextgen_pro_lightbox_legacy#theme/galleria.nextgen_pro_lightbox.js'), 'galleria');
if (!wp_style_is('fontawesome', 'registered')) {
C_Display_Type_Controller::get_instance()->enqueue_displayed_gallery_trigger_buttons_resources();
}
wp_enqueue_style('fontawesome');
// retrieve the lightbox so we can examine its settings
$mapper = C_Lightbox_Library_Mapper::get_instance();
$library = $mapper->find_by_name(NGG_PRO_LIGHTBOX, TRUE);
$library->display_settings += array('is_front_page' => is_front_page() ? 1 : 0, 'share_url' => $router->get_url('/nextgen-share/{gallery_id}/{image_id}/{named_size}', TRUE, 'root'), 'protect_images' => !empty($settings->protect_images) ? TRUE : FALSE, 'style' => str_replace('.css', '', $library->display_settings['style']), 'i18n' => array('toggle_social_sidebar' => __('Toggle social sidebar', 'nextgen-gallery-pro'), 'play_pause' => __('Play / Pause', 'nextgen-gallery-pro'), 'toggle_fullscreen' => __('Toggle fullscreen', 'nextgen-gallery-pro'), 'toggle_image_info' => __('Toggle image info', 'nextgen-gallery-pro'), 'close_window' => __('Close window', 'nextgen-gallery-pro'), 'share' => array('twitter' => __('Share on Twitter', 'nextgen-gallery-pro'), 'googlep' => __('Share on Google+', 'nextgen-gallery-pro'), 'facebook' => __('Share on Facebook', 'nextgen-gallery-pro'), 'pinterest' => __('Share on Pinterest', 'nextgen-gallery-pro'))));
// provide the current language so ajax requests can request translations in the same locale
if (defined('ICL_LANGUAGE_CODE')) {
$library->display_settings['lang'] = $router->param('lang', NULL, FALSE) ? $router->param('lang') : ICL_LANGUAGE_CODE;
}
wp_localize_script('photocrati_ajax', 'nplModalSettings', $library->display_settings);
}
self::$run_once = TRUE;
}
}
开发者ID:CodeNoEvil,项目名称:mbp_web_infrastructure,代码行数:33,代码来源:adapter.nextgen_pro_lightbox_resources.php
示例12: enqueue
/**
* Enqueue scripts and styles.
*/
public static function enqueue($element = null)
{
global $groups_version;
switch ($element) {
case 'select':
switch (self::$select) {
case 'chosen':
if (!wp_script_is('chosen')) {
wp_enqueue_script('chosen', GROUPS_PLUGIN_URL . 'js/chosen/chosen.jquery.min.js', array('jquery'), $groups_version, false);
}
if (!wp_style_is('chosen')) {
wp_enqueue_style('chosen', GROUPS_PLUGIN_URL . 'css/chosen/chosen.min.css', array(), $groups_version);
}
break;
case 'selectize':
if (!wp_script_is('selectize')) {
wp_enqueue_script('selectize', GROUPS_PLUGIN_URL . 'js/selectize/selectize.min.js', array('jquery'), $groups_version, false);
}
if (!wp_style_is('selectize')) {
wp_enqueue_style('selectize', GROUPS_PLUGIN_URL . 'css/selectize/selectize.bootstrap2.css', array(), $groups_version);
}
break;
}
break;
}
}
示例13: enqueueStyles
public function enqueueStyles()
{
if (wp_style_is('wptoolset-field-date', 'enqueued')) {
return;
}
wp_enqueue_style('wptoolset-field-date');
}
示例14: enqueueScripts
public function enqueueScripts()
{
foreach ($this->getScripts() as $script) {
$script = is_array($script) ? $script : ['file' => $script];
if ($script['file'] = $this->getScriptPath($script['file'])) {
$info = pathinfo($script['file']);
$extension = !empty($info['extension']) ? $info['extension'] : (!empty($script['type']) ? $script['type'] : false);
switch ($extension) {
case 'css':
$script = array_merge(array('dependencies' => array(), 'version' => '1.0.0', 'media' => 'all', 'enqueue' => true), $script, array('handle' => !empty($script['handle']) ? $script['handle'] : $info['filename']));
if (wp_style_is($script['handle'], 'registered')) {
wp_deregister_style($script['handle']);
}
wp_register_style($script['handle'], $script['file'], $script['dependencies'], $script['version'], $script['media']);
if ($script['enqueue']) {
wp_enqueue_style($script['handle']);
}
break;
default:
$script = array_merge(array('dependencies' => array(), 'version' => '1.0.0', 'in_footer' => true, 'localize' => false, 'enqueue' => true), $script, array('handle' => !empty($script['handle']) ? $script['handle'] : $info['filename']));
if (wp_script_is($script['handle'], 'registered')) {
wp_deregister_script($script['handle']);
}
wp_register_script($script['handle'], $script['file'], $script['dependencies'], $script['version'], $script['in_footer']);
if ($script['localize']) {
wp_localize_script($script['handle'], $script['localize']['name'], $script['localize']['data']);
}
if ($script['enqueue']) {
wp_enqueue_script($script['handle']);
}
break;
}
}
}
}
示例15: enqueue
/**
* Enqueue all scripts and styles needed when viewing the backend.
*
* @see http://codex.wordpress.org/Function_Reference/wp_style_is
* @see http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
* @see http://ottopress.com/2010/passing-parameters-from-php-to-javascripts-in-plugins/
* @see http://codex.wordpress.org/Function_Reference/wp_localize_script
* @since 1.0
*/
public function enqueue($hook_suffix)
{
$min = SCRIPT_DEBUG ? '' : '.min';
// just required on options-media.php and would produce errors pre WordPress 3.1
if ($hook_suffix == 'options-media.php' && get_bloginfo('version') >= 3.1) {
if (wp_style_is('wp-color-picker', 'registered')) {
// >=WP3.5
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('fvp_backend_35', FVP_URL . 'js/backend_35.js', array('wp-color-picker', 'jquery'), FVP_VERSION);
} else {
// <WP3.5, fallback for the new WordPress Color Picker which was added in 3.5
wp_enqueue_style('farbtastic');
wp_enqueue_script('farbtastic');
wp_enqueue_script('fvp_backend_pre35', FVP_URL . 'js/backend_pre35.js', array('jquery'), FVP_VERSION);
}
wp_enqueue_script('fvp_settings', FVP_URL . 'js/settings.js', array('jquery'), FVP_VERSION);
}
// just required on post.php and post-new.php
if ($hook_suffix == 'post.php' && isset($_GET['post']) || $hook_suffix == 'post-new.php') {
wp_enqueue_script('jquery.autosize', FVP_URL . "js/jquery.autosize{$min}.js", array('jquery'), FVP_VERSION);
wp_enqueue_script('fvp_backend', FVP_URL . "js/backend{$min}.js", array('jquery', 'jquery.autosize'), FVP_VERSION);
wp_enqueue_style('wp-mediaelement');
wp_enqueue_script('wp-mediaelement');
$options = get_option('fvp-settings');
$upload_dir = wp_upload_dir();
wp_localize_script('fvp_backend', 'fvp_backend_data', array('wp_upload_dir' => $upload_dir['baseurl'], 'loading_gif' => get_admin_url(null, 'images/loading.gif'), 'default_value' => $this->default_value, 'default_value_sec' => $this->default_value_sec, 'wp_35' => get_bloginfo('version') >= 3.5));
}
if ($hook_suffix == 'options-media.php' || ($hook_suffix == 'post.php' && isset($_GET['post']) || $hook_suffix == 'post-new.php')) {
wp_enqueue_style('fvp_backend', FVP_URL . "css/backend{$min}.css", array(), FVP_VERSION);
}
}