Replace hardcoded date and time formats with wp_option
This commit is contained in:
@@ -16,7 +16,7 @@ class Windycoys_Walker_Comments extends Walker_Comment {
|
||||
$author_email = $comment->comment_author_email;
|
||||
$author = $comment->comment_author;
|
||||
$avatar = get_avatar($comment, 128);
|
||||
$date = get_comment_date('jS F, Y', $id).' at '.get_comment_date('H:i', $id);
|
||||
$date = get_comment_date(get_option('date_format'), $id).' at '.get_comment_date(get_option('time_format'), $id);
|
||||
$content = $comment->comment_content;
|
||||
$output .= '<li class="comments__item">';
|
||||
$output .= '<div class="comment">';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
$year = date('Y', $date);
|
||||
$month = date('F', $date);
|
||||
$day = date('jS', $date);
|
||||
$date = get_the_date('jS F, Y', $post->ID).' at '.get_the_date('H:i', $post->ID);
|
||||
$date = get_the_date(get_option('date_format'), $post->ID).' at '.get_the_date(get_option('time_format'), $post->ID);
|
||||
$content = (strlen($post->post_excerpt) === 0) ?
|
||||
strip_tags(substr($post->post_content, 0, 200)).'[...]' :
|
||||
$post->post_excerpt;
|
||||
|
||||
@@ -130,7 +130,7 @@ function windycoys_get_podcast_meta($id) {
|
||||
title => (String) $item->title,
|
||||
description => (String) $item->description,
|
||||
image => (String) $item->image['href'],
|
||||
date => date('jS F, Y', $date).' at '.date('H:i', $date),
|
||||
date => date(get_option('date_format'), $date).' at '.date(get_option('time_format'), $date),
|
||||
length => (String) $item->duration,
|
||||
url => (String) $item->link,
|
||||
audio => (String) $item->enclosure['url'],
|
||||
|
||||
@@ -29,7 +29,7 @@ $results = $wp_query->found_posts;
|
||||
content => get_the_excerpt(),
|
||||
author => get_the_author_meta('nickname'),
|
||||
comments => get_comments_number(),
|
||||
date => get_the_date('jS F, Y', $id) . ' at ' . get_the_date('H:i', $id),
|
||||
date => get_the_date(get_option('date_format'), $id) . ' at ' . get_the_date(get_option('time_format'), $id),
|
||||
);
|
||||
get_template_part('partials/excerpt')
|
||||
?>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ol>
|
||||
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
|
||||
<?php $username = get_the_author_meta('nickname') ?>
|
||||
<?php $date = get_the_date('jS F, Y', $id).' at '.get_the_date('H:i', $id) ?>
|
||||
<?php $date = get_the_date(get_option('date_format'), $id).' at '.get_the_date(get_option('time_format'), $id) ?>
|
||||
<li>
|
||||
<div class="excerpt">
|
||||
<div class="excerpt__head">
|
||||
|
||||
Reference in New Issue
Block a user