mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Cacheing cleanup. Introduce get_post() and get_category(). http://mosquito.wordpress.org/view.php?id=1157
git-svn-id: https://develop.svn.wordpress.org/trunk@2478 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -193,8 +193,8 @@ function single_post_title($prefix = '', $display = true) {
|
||||
if (!$p) {
|
||||
$p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$name'");
|
||||
}
|
||||
$post_data = get_postdata($p);
|
||||
$title = $post_data['Title'];
|
||||
$post = & get_post($p);
|
||||
$title = $post->post_title;
|
||||
$title = apply_filters('single_post_title', $title);
|
||||
if ($display) {
|
||||
echo $prefix.strip_tags($title);
|
||||
@@ -347,11 +347,11 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
|
||||
}
|
||||
}
|
||||
} elseif ('postbypost' == $type) {
|
||||
$arcresults = $wpdb->get_results("SELECT ID, post_date, post_title FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
|
||||
$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
|
||||
if ($arcresults) {
|
||||
foreach ($arcresults as $arcresult) {
|
||||
if ($arcresult->post_date != '0000-00-00 00:00:00') {
|
||||
$url = get_permalink($arcresult->ID);
|
||||
$url = get_permalink($arcresult);
|
||||
$arc_title = $arcresult->post_title;
|
||||
if ($arc_title) {
|
||||
$text = strip_tags($arc_title);
|
||||
|
||||
Reference in New Issue
Block a user