0

関数をオーバーライドしようとしています(アップグレードの安全な方法で)

twentyeleven_print_link_color_style

これは、wp-content / themes / twintyeleven / inc/theme-options.phpの378行目にあります。

子テーマfunctions.phpで次のことを試しましたが、twentyeleven_print_link_color_styleがまだ起動しています(出力されているcssを確認できます)。

add_action( 'after_setup_theme', 'goodbye_internal_style_sheet' );
function goodbye_internal_style_sheet() {
    remove_filter( 'wp_head', 'twentyeleven_print_link_color_style' );
}
4

1 に答える 1

0
add_action( 'init', 'goodbye_internal_style_sheet' );
function goodbye_internal_style_sheet() {
    remove_action( 'wp_head', 'twentyeleven_print_link_color_style' );
}
  • アクションの代わりにremove_filterが必要
  • add_actionで間違ったアクションにフックしていました
于 2012-07-14T18:42:32.393 に答える