Ticket #9860: postbypost_filters_2.8.patch
| File postbypost_filters_2.8.patch, 5.1 KB (added by kevinb, 4 years ago) |
|---|
-
general-template.php
119 119 return; 120 120 121 121 $form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" > 122 <div><label class=" invisible" for="s">' . __('Search for:') . '</label>122 <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> 123 123 <input type="text" value="' . esc_attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" /> 124 124 <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> 125 125 </div> … … 187 187 $login_url = site_url('wp-login.php', 'login'); 188 188 189 189 if ( !empty($redirect) ) { 190 $login_url = add_query_arg('redirect_to', $redirect, $login_url);190 $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url); 191 191 } 192 192 193 193 return apply_filters('login_url', $login_url, $redirect); … … 873 873 } 874 874 } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { 875 875 $orderby = ('alpha' == $type) ? "post_title ASC " : "post_date DESC "; 876 $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; 876 877 $distinct = apply_filters('getarchives_distinct', "", $r); 878 $fields = apply_filters('getarchives_fields', "*", $r); 879 880 $query = "SELECT $distinct $fields FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; 881 877 882 $key = md5($query); 878 883 $cache = wp_cache_get( 'wp_get_archives' , 'general'); 879 884 if ( !isset( $cache[ $key ] ) ) { … … 1177 1182 */ 1178 1183 function the_date_xml() { 1179 1184 global $post; 1180 echo mysql2date('Y-m-d', $post->post_date );1185 echo mysql2date('Y-m-d', $post->post_date, false); 1181 1186 } 1182 1187 1183 1188 /** … … 1236 1241 */ 1237 1242 function get_the_modified_date($d = '') { 1238 1243 if ( '' == $d ) 1239 $the_time = get_post_modified_time(get_option('date_format') );1244 $the_time = get_post_modified_time(get_option('date_format'), null, null, true); 1240 1245 else 1241 $the_time = get_post_modified_time($d );1246 $the_time = get_post_modified_time($d, null, null, true); 1242 1247 return apply_filters('get_the_modified_date', $the_time, $d); 1243 1248 } 1244 1249 … … 1266 1271 $post = get_post($post); 1267 1272 1268 1273 if ( '' == $d ) 1269 $the_time = get_post_time(get_option('time_format'), false, $post );1274 $the_time = get_post_time(get_option('time_format'), false, $post, true); 1270 1275 else 1271 $the_time = get_post_time($d, false, $post );1276 $the_time = get_post_time($d, false, $post, true); 1272 1277 return apply_filters('get_the_time', $the_time, $d, $post); 1273 1278 } 1274 1279 … … 1280 1285 * @param string $d Either 'G', 'U', or php date format. 1281 1286 * @param bool $gmt Whether of not to return the gmt time. 1282 1287 * @param int|object $post Optional post ID or object. Default is global $post object. 1288 * @param bool $translate Whether to translate the time string or not 1283 1289 * @return string 1284 1290 */ 1285 function get_post_time( $d = 'U', $gmt = false, $post = null ) { // returns timestamp1291 function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { // returns timestamp 1286 1292 $post = get_post($post); 1287 1293 1288 1294 if ( $gmt ) … … 1290 1296 else 1291 1297 $time = $post->post_date; 1292 1298 1293 $time = mysql2date($d, $time );1299 $time = mysql2date($d, $time, $translate); 1294 1300 return apply_filters('get_post_time', $time, $d, $gmt); 1295 1301 } 1296 1302 … … 1315 1321 */ 1316 1322 function get_the_modified_time($d = '') { 1317 1323 if ( '' == $d ) 1318 $the_time = get_post_modified_time(get_option('time_format') );1324 $the_time = get_post_modified_time(get_option('time_format'), null, null, true); 1319 1325 else 1320 $the_time = get_post_modified_time($d );1326 $the_time = get_post_modified_time($d, null, null, true); 1321 1327 return apply_filters('get_the_modified_time', $the_time, $d); 1322 1328 } 1323 1329 … … 1328 1334 * 1329 1335 * @param string $d Either 'G', 'U', or php date format. 1330 1336 * @param bool $gmt Whether of not to return the gmt time. 1337 * @param int|object $post A post_id or post object 1338 * @param bool translate Whether to translate the result or not 1331 1339 * @return string Returns timestamp 1332 1340 */ 1333 function get_post_modified_time( $d = 'U', $gmt = false ) {1334 global $post;1341 function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1342 $post = get_post($post); 1335 1343 1336 1344 if ( $gmt ) 1337 1345 $time = $post->post_modified_gmt; 1338 1346 else 1339 1347 $time = $post->post_modified; 1340 $time = mysql2date($d, $time );1348 $time = mysql2date($d, $time, $translate); 1341 1349 1342 return apply_filters('get_ the_modified_time', $time, $d, $gmt);1350 return apply_filters('get_post_modified_time', $time, $d, $gmt); 1343 1351 } 1344 1352 1345 1353 /** … … 1351 1359 */ 1352 1360 function the_weekday() { 1353 1361 global $wp_locale, $post; 1354 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date ));1362 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date, false)); 1355 1363 $the_weekday = apply_filters('the_weekday', $the_weekday); 1356 1364 echo $the_weekday; 1357 1365 } … … 1372 1380 $the_weekday_date = ''; 1373 1381 if ( $day != $previousweekday ) { 1374 1382 $the_weekday_date .= $before; 1375 $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date ));1383 $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false)); 1376 1384 $the_weekday_date .= $after; 1377 1385 $previousweekday = $day; 1378 1386 }
