Changeset 18680
- Timestamp:
- 09/15/2011 04:54:59 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-filters.php
r18656 r18680 204 204 add_action( 'wp_head', 'rsd_link' ); 205 205 add_action( 'wp_head', 'wlwmanifest_link' ); 206 add_action( 'wp_head', 'index_rel_link' );207 add_action( 'wp_head', 'parent_post_rel_link', 10, 0 );208 add_action( 'wp_head', 'start_post_rel_link', 10, 0 );209 206 add_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); 210 207 add_action( 'wp_head', 'locale_stylesheet' ); -
trunk/wp-includes/deprecated.php
r18633 r18680 2722 2722 return $user; 2723 2723 } 2724 2725 /** 2726 * Get boundary post relational link. 2727 * 2728 * Can either be start or end post relational link. 2729 * 2730 * @since 2.8.0 2731 * @deprecated 3.3 2732 * 2733 * @param string $title Optional. Link title format. 2734 * @param bool $in_same_cat Optional. Whether link should be in same category. 2735 * @param string $excluded_categories Optional. Excluded categories IDs. 2736 * @param bool $start Optional, default is true. Whether display link to first or last post. 2737 * @return string 2738 */ 2739 function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) { 2740 _deprecated_function( __FUNCTION__, '3.3' ); 2741 2742 $posts = get_boundary_post($in_same_cat, $excluded_categories, $start); 2743 // If there is no post stop. 2744 if ( empty($posts) ) 2745 return; 2746 2747 // Even though we limited get_posts to return only 1 item it still returns an array of objects. 2748 $post = $posts[0]; 2749 2750 if ( empty($post->post_title) ) 2751 $post->post_title = $start ? __('First Post') : __('Last Post'); 2752 2753 $date = mysql2date(get_option('date_format'), $post->post_date); 2754 2755 $title = str_replace('%title', $post->post_title, $title); 2756 $title = str_replace('%date', $date, $title); 2757 $title = apply_filters('the_title', $title, $post->ID); 2758 2759 $link = $start ? "<link rel='start' title='" : "<link rel='end' title='"; 2760 $link .= esc_attr($title); 2761 $link .= "' href='" . get_permalink($post) . "' />\n"; 2762 2763 $boundary = $start ? 'start' : 'end'; 2764 return apply_filters( "{$boundary}_post_rel_link", $link ); 2765 } 2766 2767 /** 2768 * Display relational link for the first post. 2769 * 2770 * @since 2.8.0 2771 * @deprecated 3.3 2772 * 2773 * @param string $title Optional. Link title format. 2774 * @param bool $in_same_cat Optional. Whether link should be in same category. 2775 * @param string $excluded_categories Optional. Excluded categories IDs. 2776 */ 2777 function start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') { 2778 _deprecated_function( __FUNCTION__, '3.3' ); 2779 2780 echo get_boundary_post_rel_link($title, $in_same_cat, $excluded_categories, true); 2781 } 2782 2783 /** 2784 * Get site index relational link. 2785 * 2786 * @since 2.8.0 2787 * @deprecated 3.3 2788 * 2789 * @return string 2790 */ 2791 function get_index_rel_link() { 2792 _deprecated_function( __FUNCTION__, '3.3' ); 2793 2794 $link = "<link rel='index' title='" . esc_attr( get_bloginfo( 'name', 'display' ) ) . "' href='" . esc_url( user_trailingslashit( get_bloginfo( 'url', 'display' ) ) ) . "' />\n"; 2795 return apply_filters( "index_rel_link", $link ); 2796 } 2797 2798 /** 2799 * Display relational link for the site index. 2800 * 2801 * @since 2.8.0 2802 * @deprecated 3.3 2803 */ 2804 function index_rel_link() { 2805 _deprecated_function( __FUNCTION__, '3.3' ); 2806 2807 echo get_index_rel_link(); 2808 } 2809 2810 /** 2811 * Get parent post relational link. 2812 * 2813 * @since 2.8.0 2814 * @deprecated 3.3 2815 * 2816 * @param string $title Optional. Link title format. 2817 * @return string 2818 */ 2819 function get_parent_post_rel_link($title = '%title') { 2820 _deprecated_function( __FUNCTION__, '3.3' ); 2821 2822 if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) ) 2823 $post = & get_post($GLOBALS['post']->post_parent); 2824 2825 if ( empty($post) ) 2826 return; 2827 2828 $date = mysql2date(get_option('date_format'), $post->post_date); 2829 2830 $title = str_replace('%title', $post->post_title, $title); 2831 $title = str_replace('%date', $date, $title); 2832 $title = apply_filters('the_title', $title, $post->ID); 2833 2834 $link = "<link rel='up' title='"; 2835 $link .= esc_attr( $title ); 2836 $link .= "' href='" . get_permalink($post) . "' />\n"; 2837 2838 return apply_filters( "parent_post_rel_link", $link ); 2839 } 2840 2841 /** 2842 * Display relational link for parent item 2843 * 2844 * @since 2.8.0 2845 * @deprecated 3.3 2846 */ 2847 function parent_post_rel_link($title = '%title') { 2848 _deprecated_function( __FUNCTION__, '3.3' ); 2849 2850 echo get_parent_post_rel_link($title); 2851 } -
trunk/wp-includes/link-template.php
r18639 r18680 1301 1301 1302 1302 /** 1303 * Get boundary post relational link.1304 *1305 * Can either be start or end post relational link.1306 *1307 * @since 2.8.01308 *1309 * @param string $title Optional. Link title format.1310 * @param bool $in_same_cat Optional. Whether link should be in same category.1311 * @param array|string $excluded_categories Optional. Array or comma-separated list of excluded category IDs.1312 * @param bool $start Optional, default is true. Whether display link to first or last post.1313 * @return string1314 */1315 function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {1316 $posts = get_boundary_post($in_same_cat, $excluded_categories, $start);1317 // If there is no post stop.1318 if ( empty($posts) )1319 return;1320 1321 // Even though we limited get_posts to return only 1 item it still returns an array of objects.1322 $post = $posts[0];1323 1324 if ( empty($post->post_title) )1325 $post->post_title = $start ? __('First Post') : __('Last Post');1326 1327 $date = mysql2date(get_option('date_format'), $post->post_date);1328 1329 $title = str_replace('%title', $post->post_title, $title);1330 $title = str_replace('%date', $date, $title);1331 $title = apply_filters('the_title', $title, $post->ID);1332 1333 $link = $start ? "<link rel='start' title='" : "<link rel='end' title='";1334 $link .= esc_attr($title);1335 $link .= "' href='" . get_permalink($post) . "' />\n";1336 1337 $boundary = $start ? 'start' : 'end';1338 return apply_filters( "{$boundary}_post_rel_link", $link );1339 }1340 1341 /**1342 * Display relational link for the first post.1343 *1344 * @since 2.8.01345 *1346 * @param string $title Optional. Link title format.1347 * @param bool $in_same_cat Optional. Whether link should be in same category.1348 * @param array|string $excluded_categories Optional. Array or comma-separated list of excluded category IDs.1349 */1350 function start_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {1351 echo get_boundary_post_rel_link($title, $in_same_cat, $excluded_categories, true);1352 }1353 1354 /**1355 * Get site index relational link.1356 *1357 * @since 2.8.01358 *1359 * @return string1360 */1361 function get_index_rel_link() {1362 $link = "<link rel='index' title='" . esc_attr( get_bloginfo( 'name', 'display' ) ) . "' href='" . esc_url( user_trailingslashit( get_bloginfo( 'url', 'display' ) ) ) . "' />\n";1363 return apply_filters( "index_rel_link", $link );1364 }1365 1366 /**1367 * Display relational link for the site index.1368 *1369 * @since 2.8.01370 */1371 function index_rel_link() {1372 echo get_index_rel_link();1373 }1374 1375 /**1376 * Get parent post relational link.1377 *1378 * @since 2.8.01379 *1380 * @param string $title Optional. Link title format.1381 * @return string1382 */1383 function get_parent_post_rel_link($title = '%title') {1384 if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )1385 $post = & get_post($GLOBALS['post']->post_parent);1386 1387 if ( empty($post) )1388 return;1389 1390 $date = mysql2date(get_option('date_format'), $post->post_date);1391 1392 $title = str_replace('%title', $post->post_title, $title);1393 $title = str_replace('%date', $date, $title);1394 $title = apply_filters('the_title', $title, $post->ID);1395 1396 $link = "<link rel='up' title='";1397 $link .= esc_attr( $title );1398 $link .= "' href='" . get_permalink($post) . "' />\n";1399 1400 return apply_filters( "parent_post_rel_link", $link );1401 }1402 1403 /**1404 * Display relational link for parent item1405 *1406 * @since 2.8.01407 */1408 function parent_post_rel_link($title = '%title') {1409 echo get_parent_post_rel_link($title);1410 }1411 1412 /**1413 1303 * Display previous post link that is adjacent to the current post. 1414 1304 *
Note: See TracChangeset
for help on using the changeset viewer.