当前位置: 首页>>代码示例>>PHP>>正文


PHP WP_Styles::do_items方法代码示例

本文整理汇总了PHP中WP_Styles::do_items方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Styles::do_items方法的具体用法?PHP WP_Styles::do_items怎么用?PHP WP_Styles::do_items使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WP_Styles的用法示例。


在下文中一共展示了WP_Styles::do_items方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: wp_print_styles

/**
 * Display styles that are in the $handles queue.
 *
 * Passing an empty array to $handles prints the queue,
 * passing an array with one string prints that style,
 * and passing an array of strings prints those styles.
 *
 * @global WP_Styles $wp_styles The WP_Styles object for printing styles.
 *
 * @since 2.6.0
 *
 * @param string|bool|array $handles Styles to be printed. Default 'false'.
 * @return array On success, a processed array of WP_Dependencies items; otherwise, an empty array.
 */
function wp_print_styles($handles = false)
{
    if ('' === $handles) {
        // for wp_head
        $handles = false;
    }
    /**
     * Fires before styles in the $handles queue are printed.
     *
     * @since 2.6.0
     */
    if (!$handles) {
        do_action('wp_print_styles');
    }
    global $wp_styles;
    if (!is_a($wp_styles, 'WP_Styles')) {
        if (!did_action('init')) {
            _doing_it_wrong(__FUNCTION__, sprintf(__('Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.'), '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>'), '3.3');
        }
        if (!$handles) {
            return array();
        } else {
            $wp_styles = new WP_Styles();
        }
    }
    return $wp_styles->do_items($handles);
}
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:41,代码来源:functions.wp-styles.php

示例2: array

 static function do_styles($handles)
 {
     self::do_scripts('jquery');
     global $wp_styles;
     if (!is_a($wp_styles, 'WP_Styles')) {
         $wp_styles = new WP_Styles();
     }
     ob_start();
     $wp_styles->do_items((array) $handles);
     $content = str_replace(array("'", "\n"), array('"', ''), ob_get_clean());
     echo "<script type='text/javascript'>\n";
     echo "jQuery(function (\$) { \$('head').prepend('{$content}'); });\n";
     echo "</script>";
 }
开发者ID:marchibbins,项目名称:dytorworks,代码行数:14,代码来源:Util.php

示例3: wp_print_styles

/**
 * Display styles that are in the queue or part of $handles.
 *
 * @since r79
 * @uses do_action() Calls 'wp_print_styles' hook.
 * @global object $wp_styles The WP_Styles object for printing styles.
 *
 * @param array|bool $handles Styles to be printed. An empty array prints the queue,
 *  an array with one string prints that style, and an array of strings prints those styles.
 * @return bool True on success, false on failure.
 */
function wp_print_styles($handles = false)
{
    do_action('wp_print_styles');
    if ('' === $handles) {
        // for wp_head
        $handles = false;
    }
    global $wp_styles;
    if (!is_a($wp_styles, 'WP_Styles')) {
        if (!$handles) {
            return array();
        } else {
            $wp_styles = new WP_Styles();
        }
    }
    return $wp_styles->do_items($handles);
}
开发者ID:Tucev,项目名称:Glot-O-Matic,代码行数:28,代码来源:functions.wp-styles.php

示例4: wp_print_styles

/**
 * Display styles that are in the queue or part of $handles.
 *
 * @since r79
 * @uses do_action() Calls 'wp_print_styles' hook.
 * @global object $wp_styles The WP_Styles object for printing styles.
 *
 * @param array|bool $handles Styles to be printed. An empty array prints the queue,
 *  an array with one string prints that style, and an array of strings prints those styles.
 * @return bool True on success, false on failure.
 */
function wp_print_styles( $handles = false ) {
	do_action( 'wp_print_styles' );
	if ( '' === $handles ) // for wp_head
		$handles = false;

	global $wp_styles;
	if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
		if ( ! did_action( 'init' ) )
			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );

		if ( !$handles )
			return array(); // No need to instantiate if nothing is there.
		else
			$wp_styles = new WP_Styles();
	}

	return $wp_styles->do_items( $handles );
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:30,代码来源:functions.wp-styles.php

示例5: print_admin_styles

/**
 * Prints the styles queue in the HTML head on admin pages.
 *
 * @since 2.8
 */
function print_admin_styles()
{
    global $wp_styles, $concatenate_scripts, $compress_css;
    if (!is_a($wp_styles, 'WP_Styles')) {
        $wp_styles = new WP_Styles();
    }
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $zip = $compress_css ? 1 : 0;
    if ($zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP) {
        $zip = 'gzip';
    }
    $wp_styles->do_items(false);
    if (apply_filters('print_admin_styles', true)) {
        _print_styles();
    }
    $wp_styles->reset();
    return $wp_styles->done;
}
开发者ID:jawandsingh,项目名称:wordpress_with_sql_azure,代码行数:24,代码来源:script-loader.php

示例6: print_admin_styles

/**
 * Prints the styles queue in the HTML head on admin pages.
 *
 * @since 2.8.0
 */
function print_admin_styles()
{
    global $wp_styles, $concatenate_scripts;
    if (!is_a($wp_styles, 'WP_Styles')) {
        $wp_styles = new WP_Styles();
    }
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $wp_styles->do_items(false);
    /**
     * Filter whether to print the admin styles.
     *
     * @since 2.8.0
     *
     * @param bool $print Whether to print the admin styles. Default true.
     */
    if (apply_filters('print_admin_styles', true)) {
        _print_styles();
    }
    $wp_styles->reset();
    return $wp_styles->done;
}
开发者ID:hachi4,项目名称:WordPress,代码行数:27,代码来源:script-loader.php

示例7: print_admin_styles

function print_admin_styles()
{
    global $wp_styles, $concatenate_scripts, $compress_css;
    if (!is_a($wp_styles, 'WP_Styles')) {
        $wp_styles = new WP_Styles();
    }
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $zip = $compress_css ? 1 : 0;
    if ($zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP) {
        $zip = 'gzip';
    }
    $wp_styles->do_items(false);
    if (apply_filters('print_admin_styles', true)) {
        if (!empty($wp_styles->concat)) {
            $dir = $wp_styles->text_direction;
            $ver = md5("{$wp_styles->concat_version}{$dir}");
            $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=" . trim($wp_styles->concat, ', ') . "&ver={$ver}";
            echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n";
        }
        if (!empty($wp_styles->print_html)) {
            echo $wp_styles->print_html;
        }
    }
    $wp_styles->do_concat = false;
    $wp_styles->concat = $wp_styles->concat_version = $wp_styles->print_html = '';
    return $wp_styles->done;
}
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:28,代码来源:script-loader.php

示例8: print_admin_styles

/**
 * Prints the styles queue in the HTML head on admin pages.
 *
 * @since 2.8.0
 */
function print_admin_styles()
{
    global $wp_styles, $concatenate_scripts, $compress_css;
    if (!is_a($wp_styles, 'WP_Styles')) {
        $wp_styles = new WP_Styles();
    }
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $zip = $compress_css ? 1 : 0;
    if ($zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP) {
        $zip = 'gzip';
    }
    $wp_styles->do_items(false);
    /**
     * Filter whether to print the admin styles.
     *
     * @since 2.8.0
     *
     * @param bool $print Whether to print the admin styles. Default true.
     */
    if (apply_filters('print_admin_styles', true)) {
        _print_styles();
    }
    $wp_styles->reset();
    return $wp_styles->done;
}
开发者ID:stiyes,项目名称:ngionic,代码行数:31,代码来源:script-loader.php

示例9: print_styles

 /**
  * Prints specific styles.
  *
  * @param string|array $print A string, or an array of specific handles to print.
  */
 public function print_styles($print)
 {
     $this->check_arg_types(array('string', 'array'), func_get_args());
     $print = (array) $print;
     // Force an array value.
     global $wp_styles;
     // Global object reference.
     if (!$wp_styles instanceof \WP_Styles) {
         $wp_styles = new \WP_Styles();
     }
     foreach ($print = array_unique($print) as $_key => $_handle) {
         if (!$this->©string->is_not_empty($_handle) || !wp_style_is($_handle, 'registered')) {
             unset($print[$_key]);
         }
     }
     // Remove (NOT a handle, or NOT registered).
     unset($_key, $_handle);
     // Housekeeping.
     if ($print) {
         // Still have something to print?
         $wp_styles->do_items($print);
     }
 }
开发者ID:panvagenas,项目名称:x-related-posts,代码行数:28,代码来源:styles.php


注:本文中的WP_Styles::do_items方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。