I have a custom shortcode that shows the last updated date of my posts. The shortcode is ouputting the proper date but is appending the word “Array”? How do I get rid of this?
//Last Updated Date Blogs
function show_last_updated( $content ) {
$u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 86400) {
$updated_date = get_the_modified_time('m/d/Y');
$updated_time = get_the_modified_time('h:i a');
$custom_content .= '<p class="last-updated-date">Updated: '.$updated_date.'</p>';
}
$custom_content .= $content;
return $custom_content;
}
add_shortcode( 'the_content', 'show_last_updated' );