Created
August 3, 2020 08:35
-
-
Save mihdan/128af3f63bb890f386d357682aaa9bbd to your computer and use it in GitHub Desktop.
Меняем дату создания записи на дату её обновления в плагине The SEO Framework на страницах записей
This file contains 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 | |
/** | |
* Меняем дату создания записи на дату её обновления | |
* в плагине The SEO Framework на страницах записей. | |
* | |
* @param string $time Время создания записи. | |
* @param int $post_id Идентификатор записи. | |
*/ | |
add_filter( | |
'the_seo_framework_publishedtime_output', | |
function ( $time, $post_id ) { | |
if ( is_singular() ) { | |
$time = get_post_modified_time( 'c' ); | |
} | |
return $time; | |
}, | |
10, | |
2 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment