Skip to content

Commit

Permalink
Fix notice for unset update time. Fixes #402
Browse files Browse the repository at this point in the history
  • Loading branch information
Joost de Valk committed Dec 15, 2013
1 parent 5224baf commit a78c747
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inc/class-sitemaps.php
Expand Up @@ -747,7 +747,7 @@ function build_user_map() {
'loc' => $author_link,
'pri' => 0.8,
'chf' => 'weekly',
'mod' => date( 'c', $user->_yoast_wpseo_profile_updated )
'mod' => date( 'c', isset( $user->_yoast_wpseo_profile_updated ) ? $user->_yoast_wpseo_profile_updated : time() )
) );
}
}
Expand Down Expand Up @@ -935,6 +935,13 @@ private function is_user_sitemap( $type ) {
*/
private
function user_map_sorter( $a, $b ) {
if ( ! isset( $a->_yoast_wpseo_profile_updated ) ) {
$a->_yoast_wpseo_profile_updated = time();
}
if ( ! isset( $b->_yoast_wpseo_profile_updated ) ) {
$b->_yoast_wpseo_profile_updated = time();
}

if ( $a->_yoast_wpseo_profile_updated == $b->_yoast_wpseo_profile_updated ) {
return 0;
}
Expand Down

0 comments on commit a78c747

Please sign in to comment.