Skip to content

Instantly share code, notes, and snippets.

@mihdan
Created August 3, 2020 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mihdan/128af3f63bb890f386d357682aaa9bbd to your computer and use it in GitHub Desktop.
Save mihdan/128af3f63bb890f386d357682aaa9bbd to your computer and use it in GitHub Desktop.
Меняем дату создания записи на дату её обновления в плагине The SEO Framework на страницах записей
<?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