1

这是 $wp_scripts 的打印片段

WP_Scripts Object
(

[base_url] => http://*****
[content_url] => http://*****
[default_version] => 3.5.1
[in_footer] => Array
    (
    )

[concat] => 
[concat_version] => 
[do_concat] => 
[print_html] => 
[print_code] => 
[ext_handles] => 
[ext_version] => 
[default_dirs] => Array
    (
        [0] => /wp-admin/js/
        [1] => /wp-includes/js/
    )

[registered] => Array
    (
        [utils] => _WP_Dependency Object
            (
                [handle] => utils
                [src] => /wp-includes/js/utils.min.js
                [deps] => Array
                    (
                    )

我将如何提取一些数据,例如“/wp-includes/js/utils.min.js”?

谢谢

4

2 回答 2

2
$wp_scripts->registered['utils']->src

通过访问对象属性->

通过访问数组元素[/* String or integer here*/]

于 2013-02-19T16:26:44.670 回答
0
$object = new WP_Scripts;
$src = $object->registered['utils']->src;
于 2013-02-19T16:28:28.160 回答