Wordpressでbloginfo変数をオーバーライドするにはどうすればいいですか?
たとえば、これを置き換えます。
<?php bloginfo('stylesheet_directory'); ?>
http://mysites.com/hello/
のようなカスタムURLを返す
上記の例では、stylesheet_directory
フックにフィルタを追加できます
add_filter('stylesheet_directory','change_stylesheet_dir') ;
function change_stylesheet_dir($stylesheet_dir, $stylesheet, $theme_root) {
# do stuff - change the stylesheet directory
$new_stylesheet_directory = 'http://mysites.com/hello/';
return new_stylesheet_directory ;
}
Bloginfoの他のパラメータについては、wp-includes/general-template.phpにあるbloginfo
のコードを調べることができます。他のbloginfoパラメータに対する呼び出しに従って、それに対するフィルタがあるかどうかを確認してください。