Correctly add args to strings that contain only a query string and not a full URI.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6d302677fc
commit
e0d7582c46
|
@ -598,7 +598,7 @@ function wp_set_comment_status($comment_id, $comment_status) {
|
|||
}
|
||||
|
||||
if ($wpdb->query($query)) {
|
||||
do_action('wp_set_comment_status', $comment_id);
|
||||
do_action('wp_set_comment_status', $comment_id, $comment_status);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -131,7 +131,7 @@ function the_category_rss($type = 'rss') {
|
|||
$the_list .= "\n\t<category>$category->cat_name</category>";
|
||||
}
|
||||
}
|
||||
echo apply_filters('the_category_rss', $the_list);
|
||||
echo apply_filters('the_category_rss', $the_list, $type);
|
||||
}
|
||||
|
||||
function rss_enclosure() {
|
||||
|
|
|
@ -389,7 +389,7 @@ function user_can_edit_user($user_id, $other_user) {
|
|||
function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
|
||||
global $wpdb;
|
||||
|
||||
do_action('wp_blacklist_check');
|
||||
do_action('wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent);
|
||||
|
||||
if ( preg_match_all('/&#(\d+);/', $comment . $author . $url, $chars) ) {
|
||||
foreach ($chars[1] as $char) {
|
||||
|
@ -461,7 +461,7 @@ function wp_new_comment( $commentdata, $spam = false ) {
|
|||
$time_lastcomment = mysql2date('U', $lasttime);
|
||||
$time_newcomment = mysql2date('U', $now_gmt);
|
||||
if ( ($time_newcomment - $time_lastcomment) < 15 ) {
|
||||
do_action('comment_flood_trigger');
|
||||
do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment);
|
||||
die( __('Sorry, you can only post a new comment once every 15 seconds. Slow down cowboy.') );
|
||||
}
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ function wp_new_comment( $commentdata, $spam = false ) {
|
|||
");
|
||||
|
||||
$comment_id = $wpdb->insert_id;
|
||||
do_action('comment_post', $comment_id);
|
||||
do_action('comment_post', $comment_id, $approved);
|
||||
|
||||
if ( 'spam' !== $approved ) { // If it's spam save it silently for later crunching
|
||||
if ( '0' == $approved )
|
||||
|
|
|
@ -1669,7 +1669,7 @@ function add_query_arg() {
|
|||
$query = $parts[1];
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (! ststr($uri, '/')) {
|
||||
$base = $uri . '?';
|
||||
$query = '';
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ function get_author_link($echo = false, $author_id, $author_nicename) {
|
|||
$link = get_settings('home') . trailingslashit($link);
|
||||
}
|
||||
|
||||
$link = apply_filters('author_link', $link);
|
||||
$link = apply_filters('author_link', $link, $author_id, $author_nicename);
|
||||
if ($echo) echo $link;
|
||||
return $link;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ function get_category_link($echo = false, $category_id, $category_nicename) {
|
|||
$catlink = str_replace('%category%', $category_nicename, $catlink);
|
||||
$catlink = get_settings('home') . trailingslashit($catlink);
|
||||
}
|
||||
$catlink = apply_filters('category_link', $catlink);
|
||||
$catlink = apply_filters('category_link', $catlink, $category_id, $category_nicename);
|
||||
if ($echo) echo $catlink;
|
||||
return $catlink;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ function the_category($separator = '', $parents='') {
|
|||
++$i;
|
||||
}
|
||||
}
|
||||
echo apply_filters('the_category', $thelist);
|
||||
echo apply_filters('the_category', $thelist, $separator, $parents);
|
||||
}
|
||||
|
||||
function get_the_category_by_ID($cat_ID) {
|
||||
|
@ -173,7 +173,7 @@ function category_description($category = 0) {
|
|||
global $cat, $wpdb, $cache_categories;
|
||||
if (!$category) $category = $cat;
|
||||
$category_description = $cache_categories[$category]->category_description;
|
||||
$category_description = apply_filters('category_description', $category_description);
|
||||
$category_description = apply_filters('category_description', $category_description, $category);
|
||||
return $category_description;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_
|
|||
if (intval($optionnone) == 1) echo "\t<option value='0'>None</option>\n";
|
||||
if ($categories) {
|
||||
foreach ($categories as $category) {
|
||||
$cat_name = apply_filters('list_cats', $category->cat_name);
|
||||
$cat_name = apply_filters('list_cats', $category->cat_name, $category);
|
||||
echo "\t<option value=\"".$category->cat_ID."\"";
|
||||
if ($category->cat_ID == $selected)
|
||||
echo ' selected="selected"';
|
||||
|
@ -328,10 +328,10 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
|
|||
if ($use_desc_for_title == 0 || empty($category->category_description)) {
|
||||
$link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
|
||||
} else {
|
||||
$link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description)) . '"';
|
||||
$link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category)) . '"';
|
||||
}
|
||||
$link .= '>';
|
||||
$link .= apply_filters('list_cats', $category->cat_name).'</a>';
|
||||
$link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';
|
||||
|
||||
if ( (! empty($feed_image)) || (! empty($feed)) ) {
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ function wp_meta() {
|
|||
|
||||
function bloginfo($show='') {
|
||||
$info = get_bloginfo($show);
|
||||
$info = apply_filters('bloginfo', $info);
|
||||
$info = apply_filters('bloginfo', $info, $show);
|
||||
echo convert_chars($info);
|
||||
}
|
||||
|
||||
|
@ -595,7 +595,7 @@ function the_date($d='', $before='', $after='', $echo = true) {
|
|||
$the_date .= $after;
|
||||
$previousday = $day;
|
||||
}
|
||||
$the_date = apply_filters('the_date', $the_date);
|
||||
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
|
||||
if ($echo) {
|
||||
echo $the_date;
|
||||
} else {
|
||||
|
@ -604,7 +604,7 @@ function the_date($d='', $before='', $after='', $echo = true) {
|
|||
}
|
||||
|
||||
function the_time( $d = '' ) {
|
||||
echo apply_filters('the_time', get_the_time( $d ) );
|
||||
echo apply_filters('the_time', get_the_time( $d ), $d);
|
||||
}
|
||||
|
||||
function get_the_time( $d = '' ) {
|
||||
|
@ -612,7 +612,7 @@ function get_the_time( $d = '' ) {
|
|||
$the_time = get_post_time(get_settings('time_format'));
|
||||
else
|
||||
$the_time = get_post_time($d);
|
||||
return apply_filters('get_the_time', $the_time);
|
||||
return apply_filters('get_the_time', $the_time, $d);
|
||||
}
|
||||
|
||||
function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp
|
||||
|
@ -623,7 +623,7 @@ function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp
|
|||
$time = $post->post_date;
|
||||
|
||||
$time = mysql2date($d, $time);
|
||||
return apply_filters('get_the_time', $time);
|
||||
return apply_filters('get_the_time', $time, $d, $gmt);
|
||||
}
|
||||
|
||||
function the_weekday() {
|
||||
|
@ -642,7 +642,7 @@ function the_weekday_date($before='',$after='') {
|
|||
$the_weekday_date .= $after;
|
||||
$previousweekday = $day;
|
||||
}
|
||||
$the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date);
|
||||
$the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
|
||||
echo $the_weekday_date;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,10 +74,10 @@ function get_permalink($id = false) {
|
|||
$author,
|
||||
$idpost->post_name,
|
||||
);
|
||||
return apply_filters('post_link', get_settings('home') . str_replace($rewritecode, $rewritereplace, $permalink));
|
||||
return apply_filters('post_link', get_settings('home') . str_replace($rewritecode, $rewritereplace, $permalink), $idpost);
|
||||
} else { // if they're not using the fancy permalink option
|
||||
$permalink = get_settings('home') . '/?p=' . $idpost->ID;
|
||||
return apply_filters('post_link', $permalink);
|
||||
return apply_filters('post_link', $permalink, $idpost);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ function get_page_link($id = false) {
|
|||
$link = get_settings('home') . "/?page_id=$id";
|
||||
}
|
||||
|
||||
return apply_filters('page_link', $link);
|
||||
return apply_filters('page_link', $link, $id);
|
||||
}
|
||||
|
||||
function get_year_link($year) {
|
||||
|
@ -107,9 +107,9 @@ function get_year_link($year) {
|
|||
$yearlink = $wp_rewrite->get_year_permastruct();
|
||||
if (!empty($yearlink)) {
|
||||
$yearlink = str_replace('%year%', $year, $yearlink);
|
||||
return apply_filters('year_link', get_settings('home') . trailingslashit($yearlink));
|
||||
return apply_filters('year_link', get_settings('home') . trailingslashit($yearlink), $year);
|
||||
} else {
|
||||
return apply_filters('year_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year);
|
||||
return apply_filters('year_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year, $year);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,9 +121,9 @@ function get_month_link($year, $month) {
|
|||
if (!empty($monthlink)) {
|
||||
$monthlink = str_replace('%year%', $year, $monthlink);
|
||||
$monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
|
||||
return apply_filters('month_link', get_settings('home') . trailingslashit($monthlink));
|
||||
return apply_filters('month_link', get_settings('home') . trailingslashit($monthlink), $year, $month);
|
||||
} else {
|
||||
return apply_filters('month_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2));
|
||||
return apply_filters('month_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2), $year, $month);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,9 +138,9 @@ function get_day_link($year, $month, $day) {
|
|||
$daylink = str_replace('%year%', $year, $daylink);
|
||||
$daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink);
|
||||
$daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
|
||||
return apply_filters('day_link', get_settings('home') . trailingslashit($daylink));
|
||||
return apply_filters('day_link', get_settings('home') . trailingslashit($daylink), $year, $month, $day);
|
||||
} else {
|
||||
return apply_filters('day_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2));
|
||||
return apply_filters('day_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2), $year, $month, $day);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ function get_feed_link($feed='rss2') {
|
|||
$output = get_settings('siteurl') . "/wp-{$feed}.php";
|
||||
}
|
||||
|
||||
return apply_filters('feed_link', $output);
|
||||
return apply_filters('feed_link', $output, $feed);
|
||||
}
|
||||
|
||||
function edit_post_link($link = 'Edit This', $before = '', $after = '') {
|
||||
|
@ -264,7 +264,7 @@ function previous_post_link($format='« %link', $link='%title', $in_same_ca
|
|||
return;
|
||||
}
|
||||
|
||||
$title = apply_filters('the_title', $post->post_title);
|
||||
$title = apply_filters('the_title', $post->post_title, $post);
|
||||
|
||||
$string = '<a href="'.get_permalink($post->ID).'">';
|
||||
|
||||
|
@ -284,7 +284,7 @@ function next_post_link($format='%link »', $link='%title', $in_same_cat =
|
|||
return;
|
||||
}
|
||||
|
||||
$title = apply_filters('the_title', $post->post_title);
|
||||
$title = apply_filters('the_title', $post->post_title, $post);
|
||||
|
||||
$string = '<a href="'.get_permalink($post->ID).'">';
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ function the_ID() {
|
|||
function the_title($before = '', $after = '', $echo = true) {
|
||||
$title = get_the_title();
|
||||
if (!empty($title)) {
|
||||
$title = apply_filters('the_title', $before . $title . $after);
|
||||
$title = apply_filters('the_title', $before . $title . $after, $before, $after);
|
||||
if ($echo)
|
||||
echo $title;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue