Changeset 54842
- Timestamp:
- 11/15/2022 12:32:04 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r54841 r54842 1753 1753 * @since 1.5.0 1754 1754 * 1755 * @param bool $in_same_term Optional. Whether post should be in a same taxonomy term. Default false. 1756 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 1757 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1758 * @return WP_Post|null|string Post object if successful. Null if global $post is not set. Empty string if no 1759 * corresponding post exists. 1755 * @param bool $in_same_term Optional. Whether post should be in the same taxonomy term. 1756 * Default false. 1757 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 1758 * Default empty. 1759 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 1760 * @return WP_Post|null|string Post object if successful. Null if global `$post` is not set. 1761 * Empty string if no corresponding post exists. 1760 1762 */ 1761 1763 function get_previous_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { … … 1768 1770 * @since 1.5.0 1769 1771 * 1770 * @param bool $in_same_term Optional. Whether post should be in a same taxonomy term. Default false. 1771 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 1772 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1773 * @return WP_Post|null|string Post object if successful. Null if global $post is not set. Empty string if no 1774 * corresponding post exists. 1772 * @param bool $in_same_term Optional. Whether post should be in the same taxonomy term. 1773 * Default false. 1774 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 1775 * Default empty. 1776 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 1777 * @return WP_Post|null|string Post object if successful. Null if global `$post` is not set. 1778 * Empty string if no corresponding post exists. 1775 1779 */ 1776 1780 function get_next_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { … … 1787 1791 * @global wpdb $wpdb WordPress database abstraction object. 1788 1792 * 1789 * @param bool $in_same_term Optional. Whether post should be in a same taxonomy term. Default false. 1790 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty string. 1791 * @param bool $previous Optional. Whether to retrieve previous post. Default true 1792 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1793 * @return WP_Post|null|string Post object if successful. Null if global $post is not set. Empty string if no 1794 * corresponding post exists. 1793 * @param bool $in_same_term Optional. Whether post should be in the same taxonomy term. 1794 * Default false. 1795 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 1796 * Default empty string. 1797 * @param bool $previous Optional. Whether to retrieve previous post. 1798 * Default true. 1799 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 1800 * @return WP_Post|null|string Post object if successful. Null if global `$post` is not set. 1801 * Empty string if no corresponding post exists. 1795 1802 */ 1796 1803 function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { … … 1920 1927 * 1921 1928 * @param string $join The JOIN clause in the SQL. 1922 * @param bool $in_same_term Whether post should be in asame taxonomy term.1929 * @param bool $in_same_term Whether post should be in the same taxonomy term. 1923 1930 * @param int[]|string $excluded_terms Array of excluded term IDs. Empty string if none were provided. 1924 1931 * @param string $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true. … … 1942 1949 * 1943 1950 * @param string $where The `WHERE` clause in the SQL. 1944 * @param bool $in_same_term Whether post should be in asame taxonomy term.1951 * @param bool $in_same_term Whether post should be in the same taxonomy term. 1945 1952 * @param int[]|string $excluded_terms Array of excluded term IDs. Empty string if none were provided. 1946 1953 * @param string $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true. … … 2002 2009 * 2003 2010 * @param string $title Optional. Link title format. Default '%title'. 2004 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2005 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 2006 * @param bool $previous Optional. Whether to display link to previous or next post. Default true. 2007 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2011 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2012 * Default false. 2013 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2014 * Default empty. 2015 * @param bool $previous Optional. Whether to display link to previous or next post. 2016 * Default true. 2017 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2008 2018 * @return string|void The adjacent post relational link URL. 2009 2019 */ … … 2066 2076 * 2067 2077 * @param string $title Optional. Link title format. Default '%title'. 2068 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2069 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 2070 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2078 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2079 * Default false. 2080 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2081 * Default empty. 2082 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2071 2083 */ 2072 2084 function adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { … … 2101 2113 * 2102 2114 * @param string $title Optional. Link title format. Default '%title'. 2103 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2104 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 2105 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2106 */ 2107 function next_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { 2108 echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy ); 2109 } 2110 2111 /** 2112 * Displays the relational link for the previous post adjacent to the current post. 2113 * 2114 * @since 2.8.0 2115 * 2116 * @see get_adjacent_post_rel_link() 2117 * 2118 * @param string $title Optional. Link title format. Default '%title'. 2119 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2120 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default true. 2121 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2122 */ 2123 function prev_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { 2124 echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy ); 2125 } 2126 2127 /** 2128 * Retrieves the boundary post. 2129 * 2130 * Boundary being either the first or last post by publish date within the constraints specified 2131 * by $in_same_term or $excluded_terms. 2132 * 2133 * @since 2.8.0 2134 * 2135 * @param bool $in_same_term Optional. Whether returned post should be in a same taxonomy term. 2115 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2136 2116 * Default false. 2137 2117 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2138 2118 * Default empty. 2139 * @param bool $start Optional. Whether to retrieve first or last post. Default true 2140 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2141 * @return null|array Array containing the boundary post object if successful, null otherwise. 2119 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2120 */ 2121 function next_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { 2122 echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy ); 2123 } 2124 2125 /** 2126 * Displays the relational link for the previous post adjacent to the current post. 2127 * 2128 * @since 2.8.0 2129 * 2130 * @see get_adjacent_post_rel_link() 2131 * 2132 * @param string $title Optional. Link title format. Default '%title'. 2133 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2134 * Default false. 2135 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2136 * Default true. 2137 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2138 */ 2139 function prev_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { 2140 echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy ); 2141 } 2142 2143 /** 2144 * Retrieves the boundary post. 2145 * 2146 * Boundary being either the first or last post by publish date within the constraints specified 2147 * by `$in_same_term` or `$excluded_terms`. 2148 * 2149 * @since 2.8.0 2150 * 2151 * @param bool $in_same_term Optional. Whether returned post should be in the same taxonomy term. 2152 * Default false. 2153 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2154 * Default empty. 2155 * @param bool $start Optional. Whether to retrieve first or last post. 2156 * Default true. 2157 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2158 * @return array|null Array containing the boundary post object if successful, null otherwise. 2142 2159 */ 2143 2160 function get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' ) { … … 2199 2216 * @param string $format Optional. Link anchor format. Default '« %link'. 2200 2217 * @param string $link Optional. Link permalink format. Default '%title'. 2201 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2202 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 2203 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2218 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2219 * Default false. 2220 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2221 * Default empty. 2222 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2204 2223 * @return string The link URL of the previous post in relation to the current post. 2205 2224 */ … … 2217 2236 * @param string $format Optional. Link anchor format. Default '« %link'. 2218 2237 * @param string $link Optional. Link permalink format. Default '%title'. 2219 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2220 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 2221 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2238 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2239 * Default false. 2240 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2241 * Default empty. 2242 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2222 2243 */ 2223 2244 function previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { … … 2232 2253 * @param string $format Optional. Link anchor format. Default '« %link'. 2233 2254 * @param string $link Optional. Link permalink format. Default '%title'. 2234 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2235 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 2236 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2255 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2256 * Default false. 2257 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2258 * Default empty. 2259 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2237 2260 * @return string The link URL of the next post in relation to the current post. 2238 2261 */ … … 2249 2272 * 2250 2273 * @param string $format Optional. Link anchor format. Default '« %link'. 2251 * @param string $link Optional. Link permalink format. Default '%title' 2252 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2253 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. 2254 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2274 * @param string $link Optional. Link permalink format. Default '%title'. 2275 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2276 * Default false. 2277 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 2278 * Default empty. 2279 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2255 2280 */ 2256 2281 function next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { … … 2267 2292 * @param string $format Link anchor format. 2268 2293 * @param string $link Link permalink format. 2269 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2270 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. Default empty. 2271 * @param bool $previous Optional. Whether to display link to previous or next post. Default true. 2272 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2294 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2295 * Default false. 2296 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. 2297 * Default empty. 2298 * @param bool $previous Optional. Whether to display link to previous or next post. 2299 * Default true. 2300 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2273 2301 * @return string The link URL of the previous or next post in relation to the current post. 2274 2302 */ … … 2337 2365 * @param string $format Link anchor format. 2338 2366 * @param string $link Link permalink format. 2339 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. 2340 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. Default empty. 2341 * @param bool $previous Optional. Whether to display link to previous or next post. Default true. 2342 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 2367 * @param bool $in_same_term Optional. Whether link should be in the same taxonomy term. 2368 * Default false. 2369 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. 2370 * Default empty. 2371 * @param bool $previous Optional. Whether to display link to previous or next post. 2372 * Default true. 2373 * @param string $taxonomy Optional. Taxonomy, if `$in_same_term` is true. Default 'category'. 2343 2374 */ 2344 2375 function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { … … 2354 2385 * 2355 2386 * @param int $pagenum Optional. Page number. Default 1. 2356 * @param bool $escape Optional. Whether to escape the URL for display, with esc_url(). Defaults to true.2357 * Otherwise, prepares the URL with sanitize_url().2387 * @param bool $escape Optional. Whether to escape the URL for display, with esc_url(). 2388 * If set to false, prepares the URL with sanitize_url(). Default true. 2358 2389 * @return string The link URL for the given page number. 2359 2390 */ … … 2684 2715 * Optional. Default post navigation arguments. Default empty array. 2685 2716 * 2686 * @type string $prev_text Anchor text to display in the previous post link. Default '%title'. 2687 * @type string $next_text Anchor text to display in the next post link. Default '%title'. 2688 * @type bool $in_same_term Whether link should be in a same taxonomy term. Default false. 2689 * @type int[]|string $excluded_terms Array or comma-separated list of excluded term IDs. Default empty. 2717 * @type string $prev_text Anchor text to display in the previous post link. 2718 * Default '%title'. 2719 * @type string $next_text Anchor text to display in the next post link. 2720 * Default '%title'. 2721 * @type bool $in_same_term Whether link should be in the same taxonomy term. 2722 * Default false. 2723 * @type int[]|string $excluded_terms Array or comma-separated list of excluded term IDs. 2724 * Default empty. 2690 2725 * @type string $taxonomy Taxonomy, if `$in_same_term` is true. Default 'category'. 2691 * @type string $screen_reader_text Screen reader text for the nav element. Default 'Post navigation'. 2726 * @type string $screen_reader_text Screen reader text for the nav element. 2727 * Default 'Post navigation'. 2692 2728 * @type string $aria_label ARIA label text for the nav element. Default 'Posts'. 2693 2729 * @type string $class Custom class for the nav element. Default 'post-navigation'.
Note: See TracChangeset
for help on using the changeset viewer.