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 に答える