Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'media_send_to_editor', 'disable_a_tags_in_gallery', 999, 3 ); | |
function disable_a_tags_in_gallery( $html ) { | |
return preg_replace( '/<a .*?>(.*?)<\/a>/', '$1', $html ); | |
} | |
?> |
Note
Description | ギャラリーに挿入されるリンクを強制削除する |
---|---|
WordPress Ver. | 3.3.1 |
Via | アップロード画像へのリンクを消したい |