Changeset 18680 for trunk/wp-includes/deprecated.php
- Timestamp:
- 09/15/2011 04:54:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.