んー、タグを付けただけで、Modified Date が変わってしまう。これ変えないようにするかな。アイコン用タクソノミーなので…
Postscripts
できた。
123456789101112131415161718192021222324252627282930313233343536373839404142class TwentySeventeenTechnotes_Note_ModifiedDateProtector {public $aPostTypeSlugs = array(); // e.g. note/*** Performs necessary set-ups.*/public function __construct( $asPostTypeSlug ) {$this->aPostTypeSlugs = ( array ) $asPostTypeSlug;add_filter( 'wp_insert_post_data', array( $this, 'replyToProtectModifiedDate' ), 10, 2 );}public function replyToProtectModifiedDate( $aData, $aPost ){if ( ! in_array( $aData[ 'post_type' ], $this->aPostTypeSlugs ) ) {return $aData;}if ( empty( $aPost[ 'ID' ] ) ) {return $aData;}$_oOldPost = get_post( $aPost[ 'ID' ] );if ( empty( $_oOldPost ) ) {return $aData;}// When the content is the same, then do not update the modified date.if ( $_oOldPost->post_content === $aData[ 'post_content' ] ) {$aData[ 'post_modified' ] = $_oOldPost->post_modified;$aData[ 'post_modified_gmt' ] = $_oOldPost->post_modified_gmt;}return $aData;}}