複数の関数で満たされたいくつかの PHP ファイルがあります。それらを functions1.php、functions2.php、functions3.php と呼びましょう:
function function_something( $atts ) {
extract( something_atts( array(
'foo' => 'bar',
'bar' => 'foo,
), $atts ) );
return 'something';
}
これらのファイルを次のように all_functions.php 内にロードしています。
require_once('functions1.php');
require_once('functions2.php');
require_once('functions3.php');
これらすべての関数とその属性の配列を作成できるかどうか疑問に思っていますか?
私は次のようなことを考えています:
function my_functions() {
require_once('functions1.php');
require_once('functions2.php');
require_once('functions3.php');
}
そして、いくつかの foreach ループがありますが、結局のところどのように見えるべきかわかりません。
これはおそらくトリッキーに見えますが、PHP の Reflection API を使用せずにすべての WordPress ショートコードをリストできるかどうかに興味があります :)