| | 1329 | /* |
| | 1330 | * Get previous post link that is adjacent to the current post. |
| | 1331 | * |
| | 1332 | * @since 3.5.0 |
| | 1333 | * |
| | 1334 | * @param string $format Optional. Link anchor format. |
| | 1335 | * @param string $link Optional. Link permalink format. |
| | 1336 | * @param bool $in_same_cat Optional. Whether link should be in same category. |
| | 1337 | * @param string $excluded_categories Optional. Excluded categories IDs. |
| | 1338 | * @return string |
| | 1339 | */ |
| | 1340 | function get_previous_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1341 | return get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_categories, true ); |
| | 1342 | } |
| | 1343 | |
| 1339 | | function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') { |
| 1340 | | adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, true); |
| | 1355 | function previous_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1356 | echo get_previous_post_link( $format, $link, $in_same_cat, $excluded_categories ); |
| | 1357 | } |
| | 1358 | |
| | 1359 | /** |
| | 1360 | * Get previous post link that is adjacent to the current post. |
| | 1361 | * |
| | 1362 | * @since 3.5.0 |
| | 1363 | * |
| | 1364 | * @param string $format Optional. Link anchor format. |
| | 1365 | * @param string $link Optional. Link permalink format. |
| | 1366 | * @param bool $in_same_cat Optional. Whether link should be in same category. |
| | 1367 | * @param string $excluded_categories Optional. Excluded categories IDs. |
| | 1368 | * @return string |
| | 1369 | */ |
| | 1370 | function get_next_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1371 | return get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_categories, false ); |
| 1353 | | function next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') { |
| 1354 | | adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, false); |
| | 1385 | function next_post_link( $format = '%link »', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1386 | echo get_next_post_link( $format, $link, $in_same_cat, $excluded_categories ); |
| | 1433 | * Display adjacent post link. |
| | 1434 | * |
| | 1435 | * Can be either next post link or previous. |
| | 1436 | * |
| | 1437 | * @since 2.5.0 |
| | 1438 | * @uses get_adjacent_post_link() |
| | 1439 | * |
| | 1440 | * @param string $format Link anchor format. |
| | 1441 | * @param string $link Link permalink format. |
| | 1442 | * @param bool $in_same_cat Optional. Whether link should be in same category. |
| | 1443 | * @param string $excluded_categories Optional. Excluded categories IDs. |
| | 1444 | * @param bool $previous Optional, default is true. Whether display link to previous post. |
| | 1445 | */ |
| | 1446 | function adjacent_post_link( $format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true ) { |
| | 1447 | echo get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_categories, $previous ); |
| | 1448 | } |
| | 1449 | |
| | 1450 | /** |