本文整理汇总了PHP中wp_style_add_data函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_style_add_data函数的具体用法?PHP wp_style_add_data怎么用?PHP wp_style_add_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_style_add_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_core_register_common_styles
/**
* Register styles commonly used by BuddyPress.
*
* @since 2.1.0
*/
function bp_core_register_common_styles()
{
$min = bp_core_get_minified_asset_suffix();
$url = buddypress()->plugin_url . 'bp-core/css/';
/**
* Filters the URL for the Admin Bar stylesheet.
*
* @since 1.1.0
*
* @param string $value URL for the Admin Bar stylesheet.
*/
$admin_bar_file = apply_filters('bp_core_admin_bar_css', "{$url}admin-bar{$min}.css");
/**
* Filters the BuddyPress Core stylesheet files to register.
*
* @since 2.1.0
*
* @param array $value Array of stylesheet file information to register.
*/
$styles = apply_filters('bp_core_register_common_styles', array('bp-admin-bar' => array('file' => $admin_bar_file, 'dependencies' => array('admin-bar')), 'bp-avatar' => array('file' => "{$url}avatar{$min}.css", 'dependencies' => array('jcrop'))));
foreach ($styles as $id => $style) {
wp_register_style($id, $style['file'], $style['dependencies'], bp_get_version());
wp_style_add_data($id, 'rtl', true);
if ($min) {
wp_style_add_data($id, 'suffix', $min);
}
}
}
示例2: tinytheme_scripts_and_styles_setup
function tinytheme_scripts_and_styles_setup()
{
// Load the icon font stylesheet
wp_enqueue_style('tinytheme-icon-font', get_template_directory_uri() . '/stylesheet/font-awesome.min.css');
wp_enqueue_style('tinytheme-icon-font-ie', get_template_directory_uri() . '/stylesheet/font-awesome-ie7.min.css', array('tinytheme-icon-font'));
wp_style_add_data('tinytheme-icon-font-ie', 'conditional', 'IE 7');
}
示例3: enqueue_styles
/**
* Enqueue Storefront Styles
*
* @return void
*/
public function enqueue_styles()
{
global $storefront_version, $storechild_version;
/**
* Styles
*/
wp_enqueue_style('storefront-style', get_template_directory_uri() . '/style.css', $storefront_version);
wp_style_add_data('storefront-child-style', 'rtl', 'replace');
/**
* Javascript
*/
wp_enqueue_script('storechild', get_stylesheet_directory_uri() . '/assets/js/storechild.min.js', array('jquery'), $storechild_version, true);
}
示例4: ambition_scripts_styles_method
/**
* Register jquery scripts
*/
function ambition_scripts_styles_method()
{
global $disable_slider, $ambition_settings;
/**
* Loads our main stylesheet.
*/
// Load our main stylesheet.
wp_enqueue_style('ambition_style', get_stylesheet_uri());
wp_style_add_data('ambition-ie', 'conditional', 'lt IE 9');
/**
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('jquery_cycle', get_template_directory_uri() . '/js/jquery.cycle.all.min.js', array('jquery'), '2.9999.5', true);
wp_enqueue_style('ambition-fonts', ambition_font_url(), array(), null);
/**
* Enqueue Slider setup js file.
* Enqueue Fancy Box setup js and css file.
*/
$disable_slider = $ambition_settings['disable_slider'];
if ((is_home() || is_front_page()) && empty($disable_slider)) {
wp_enqueue_script('ambition_slider', get_template_directory_uri() . '/js/ambition-slider-setting.js', array('jquery_cycle'), false, true);
}
wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js', array('jquery'), false, true);
wp_enqueue_style('ambition-fonts');
}
示例5: add_scripts
/**
* @author Vanderson Sena
* @since Quatro Rodas
*/
function add_scripts()
{
// Add Genericons, used in the main stylesheet.
wp_enqueue_style('genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1');
// Theme stylesheet.
wp_enqueue_style('quatrorodas-style', get_stylesheet_uri());
// Load the Internet Explorer specific stylesheet.
wp_enqueue_style('quatrorodas-ie', get_template_directory_uri() . '/css/ie.css', array('quatrorodas-style'), '20150825');
wp_style_add_data('quatrorodas-ie', 'conditional', 'lt IE 10');
// Load the Internet Explorer 8 specific stylesheet.
wp_enqueue_style('quatrorodas-ie8', get_template_directory_uri() . '/css/ie8.css', array('quatrorodas-style'), '20150825');
wp_style_add_data('quatrorodas-ie8', 'conditional', 'lt IE 9');
// Load the Internet Explorer 7 specific stylesheet.
wp_enqueue_style('quatrorodas-ie7', get_template_directory_uri() . '/css/ie7.css', array('quatrorodas-style'), '20150825');
wp_style_add_data('quatrorodas-ie7', 'conditional', 'lt IE 8');
// Load the html5 shiv.
wp_enqueue_script('quatrorodas-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3');
wp_script_add_data('quatrorodas-html5', 'conditional', 'lt IE 9');
wp_enqueue_script('quatrorodas-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20150825', true);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
if (is_singular() && wp_attachment_is_image()) {
wp_enqueue_script('quatrorodas-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array('jquery'), '20150825');
}
wp_enqueue_script('quatrorodas-script', get_template_directory_uri() . '/js/functions.js', array('jquery'), '20150825', true);
wp_localize_script('quatrorodas-script', 'screenReaderText', array('expand' => __('expand child menu', 'quatrorodas'), 'collapse' => __('collapse child menu', 'quatrorodas')));
}
示例6: allurer_scripts
function allurer_scripts()
{
global $wp_styles;
// Bump this when changes are made to bust cache
$allurer_theme = wp_get_theme();
$version = $allurer_theme->get('Version');
// CSS Scripts
// Add our fonts, used in the main stylesheet.
wp_enqueue_style('allurer-fonts', allurer_font_url(), array(), null);
wp_enqueue_style('allurer-style', get_template_directory_uri() . '/assets/css/style.css', false, $version, 'all');
wp_enqueue_style('allurer-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css', false, $version, 'all');
wp_enqueue_style('allurer-custom', get_template_directory_uri() . '/assets/css/custom.css', false, $version, 'all');
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/font-awesome/css/font-awesome.css', false, $version, 'all');
// Load style.css from child theme
if (is_child_theme()) {
wp_enqueue_style('allurer-child', get_stylesheet_uri(), false, $version, null);
}
// Loads the Internet Explorer specific stylesheet.
wp_enqueue_style('allurer-ie', get_template_directory_uri() . '/assets/css/ie.css', array('allurer-style'), $version);
wp_style_add_data('allurer-ie', 'conditional', 'lt IE 8');
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_enqueue_script('bootstrap.js', get_template_directory_uri() . '/assets/js/bootstrap.js', array('jquery'), $version, true);
wp_enqueue_script('allurer-custom-js', get_template_directory_uri() . '/assets/js/custom.js', array('jquery'), false, true);
wp_enqueue_script('modernizr.js', get_template_directory_uri() . '/assets/js/modernizr.custom.79639.js', array('jquery'), $version, false);
wp_enqueue_script('allurer-html5shiv', get_template_directory_uri() . '/js/html5.js', array(), '3.7.0', false);
}
示例7: zerif_scripts
function zerif_scripts()
{
wp_enqueue_style('zerif_font', zerif_slug_fonts_url(), array(), null);
wp_enqueue_style('zerif_font_all', '//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600italic,600,700,700italic,800,800italic');
wp_enqueue_style('zerif_bootstrap_style', get_template_directory_uri() . '/assets/css/bootstrap.css');
wp_style_add_data('zerif_bootstrap_style', 'rtl', 'replace');
wp_enqueue_style('zerif_fontawesome', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(), 'v1');
wp_enqueue_style('zerif_pixeden_style', get_template_directory_uri() . '/assets/css/pixeden-icons.css', array('zerif_fontawesome'), 'v1');
wp_enqueue_style('zerif_style', get_stylesheet_uri(), array('zerif_pixeden_style'), 'v1');
wp_enqueue_style('zerif_responsive_style', get_template_directory_uri() . '/assets/css/responsive.css', array('zerif_style'), 'v1');
if (wp_is_mobile()) {
wp_enqueue_style('zerif_style_mobile', get_template_directory_uri() . '/assets/css/style-mobile.css', array('zerif_bootstrap_style', 'zerif_style'), 'v1');
}
wp_enqueue_script('jquery');
wp_enqueue_script('zerif_bootstrap_script', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), '20120206', true);
wp_enqueue_script('zerif_knob_nav', get_template_directory_uri() . '/assets/js/jquery.knob.js', array("jquery"), '20120206', true);
wp_enqueue_script('zerif_smoothscroll', get_template_directory_uri() . '/assets/js/smoothscroll.js', array("jquery"), '20120206', true);
if (!wp_is_mobile()) {
wp_enqueue_script('zerif_scrollReveal_script', get_template_directory_uri() . '/assets/js/scrollReveal.js', array("jquery"), '20120206', true);
}
wp_enqueue_script('zerif_script', get_template_directory_uri() . '/assets/js/zerif.js', array("jquery", "zerif_knob_nav"), '20120206', true);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
示例8: bp_activity_mentions_script
/**
* Enqueue @mentions JS.
*
* @since 2.1.0
*/
function bp_activity_mentions_script()
{
if (!bp_activity_maybe_load_mentions_scripts()) {
return;
}
// Special handling for New/Edit screens in wp-admin.
if (is_admin()) {
if (!get_current_screen() || !in_array(get_current_screen()->base, array('page', 'post')) || !post_type_supports(get_current_screen()->post_type, 'editor')) {
return;
}
}
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script('bp-mentions', buddypress()->plugin_url . "bp-activity/js/mentions{$min}.js", array('jquery', 'jquery-atwho'), bp_get_version(), true);
wp_enqueue_style('bp-mentions-css', buddypress()->plugin_url . "bp-activity/css/mentions{$min}.css", array(), bp_get_version());
wp_style_add_data('bp-mentions-css', 'rtl', true);
if ($min) {
wp_style_add_data('bp-mentions-css', 'suffix', $min);
}
// If the script has been enqueued, let's attach our mentions TinyMCE init callback.
add_filter('tiny_mce_before_init', 'bp_add_mentions_on_tinymce_init', 10, 2);
/**
* Fires at the end of the Activity Mentions script.
*
* This is the hook where BP components can add their own prefetched results
* friends to the page for quicker @mentions lookups.
*
* @since 2.1.0
*/
do_action('bp_activity_mentions_prime_results');
}
示例9: in_the_beginning_enqueue_assets
/**
* Enqueue theme assets.
*
* @since 1.0.0
*/
function in_the_beginning_enqueue_assets()
{
// Load Google fonts
wp_enqueue_style('in-the-beginning-fonts', in_the_beginning_fonts_url(), array(), null);
// Replace style.css with style-rtl.css for RTL languages
wp_style_add_data('in-the-beginning', 'rtl', 'replace');
}
示例10: twentysixteen_infinite_scroll_enqueue_styles
/**
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
*/
function twentysixteen_infinite_scroll_enqueue_styles()
{
if (wp_script_is('the-neverending-homepage')) {
wp_enqueue_style('infinity-twentysixteen', plugins_url('twentysixteen.css', __FILE__), array('the-neverending-homepage'), '20151102');
wp_style_add_data('infinity-twentysixteen', 'rtl', 'replace');
}
}
示例11: utthehill_scripts_styles
/**
* Enqueue scripts and styles for the front end.
*
* @since Twenty Thirteen 1.0
*
* @return void
*/
function utthehill_scripts_styles()
{
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', "//code.jquery.com/jquery-1.11.2.min.js", array(), null, false);
wp_enqueue_script('jquery');
}
/*
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
// Loads UTK JavaScript with added object data fromthe WP table
// FOR TESTING
// wp_register_script( 'utthehill-utk', get_template_directory_uri() . '/library/js/build/utk-build.js', array( 'jquery' ), '2015-05-13', true );
// FOR PROD
wp_register_script('utthehill-utk', get_template_directory_uri() . '/library/js/min/utk-min.js', array('jquery'), '2015-05-20', true);
// Setup some vars to pass to js
$tempDirectory = get_template_directory_uri();
global $blog_id;
$siteId = $blog_id;
$contentArray = generateJson();
$translation_array = array('templateDirectory' => $tempDirectory, 'siteId' => $siteId, 'contentArray' => $contentArray);
wp_localize_script('utthehill-utk', 'url_object', $translation_array);
// run it Lola
wp_enqueue_script('utthehill-utk');
// Loads our main stylesheet.
wp_enqueue_style('utthehill-style', get_stylesheet_uri(), array(), '2015-05-20');
// Loads the Internet Explorer specific stylesheet.
wp_enqueue_style('utthehill-ie', get_template_directory_uri() . '/library/css/ie.css', array('utthehill-style'), '2015-05-20');
wp_style_add_data('utthehill-ie', 'conditional', 'lt IE 9');
}
示例12: jetpack_scripts
/**
* Enqueue jetpack styles.
* @since 1.6.1
*/
public function jetpack_scripts()
{
global $storefront_version;
if (class_exists('Jetpack')) {
wp_enqueue_style('storefront-jetpack-style', get_template_directory_uri() . '/inc/jetpack/css/jetpack.css', '', $storefront_version);
wp_style_add_data('storefront-jetpack-style', 'rtl', 'replace');
}
}
示例13: profile_scripts
function profile_scripts()
{
wp_enqueue_script('post-by-email', plugins_url('post-by-email/post-by-email.js', __FILE__), array('jquery'));
wp_enqueue_style('post-by-email', plugins_url('post-by-email/post-by-email.css', __FILE__));
wp_style_add_data('post-by-email', 'jetpack-inline', true);
// Do we really need `admin_styles`? With the new admin UI, it's breaking some bits.
// Jetpack::init()->admin_styles();
}
示例14: afia_enqueue_scripts
/**
* Enqueue scripts and styles.
*/
function afia_enqueue_scripts()
{
wp_enqueue_style('genericon', get_template_directory_uri() . '/assets/css/font-awesome.min.css');
wp_enqueue_style('style', get_stylesheet_uri(), array(), false, 'all');
wp_enqueue_style('handheld', get_template_directory_uri() . '/assets/css/handheld.css', array(), false, 'all and (max-device-width:768px)');
wp_enqueue_script('ie_html5shiv', get_template_directory_uri() . '/lib/js/html5.js');
wp_style_add_data('ie_html5shiv', 'conditional', 'lt IE 9');
}
示例15: load_css
/**
* Load all required CSS files on the front end.
*
* Developers can disable our CSS by filtering wp_featherlight_load_css to
* false within their theme or plugin.
*
* @since 0.1.0
* @access public
* @return void
*/
public function load_css()
{
if (!apply_filters('wp_featherlight_load_css', true)) {
return;
}
wp_enqueue_style('wp-featherlight', "{$this->url}css/wp-featherlight{$this->suffix}.css", array(), $this->version);
wp_style_add_data('wp-featherlight', 'rtl', 'replace');
wp_style_add_data('wp-featherlight', 'suffix', $this->suffix);
}