Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress本文の特定の文字列の見出しを変更する
add_filter('the_content','change_h2_to_but');
function change_h2_to_but( $content ){
return str_replace('<h2>しかし…</h2>','<h2 id="but">しかし…</h2>', $content );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment