| | 1340 | /* |
| | 1341 | * Get previous post link that is adjacent to the current post. |
| | 1342 | * |
| | 1343 | * @since 3.7.0 |
| | 1344 | * |
| | 1345 | * @param string $format Optional. Link anchor format. |
| | 1346 | * @param string $link Optional. Link permalink format. |
| | 1347 | * @param bool $in_same_cat Optional. Whether link should be in same category. |
| | 1348 | * @param string $excluded_categories Optional. Excluded categories IDs. |
| | 1349 | * @return string |
| | 1350 | */ |
| | 1351 | function get_previous_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1352 | return get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_categories, true ); |
| | 1353 | } |
| | 1354 | |
| 1350 | | function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') { |
| 1351 | | adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, true); |
| | 1366 | function previous_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1367 | echo get_previous_post_link( $format, $link, $in_same_cat, $excluded_categories ); |
| | 1371 | * Get previous post link that is adjacent to the current post. |
| | 1372 | * |
| | 1373 | * @since 3.7.0 |
| | 1374 | * @uses get_next_post_link() |
| | 1375 | * |
| | 1376 | * @param string $format Optional. Link anchor format. |
| | 1377 | * @param string $link Optional. Link permalink format. |
| | 1378 | * @param bool $in_same_cat Optional. Whether link should be in same category. |
| | 1379 | * @param string $excluded_categories Optional. Excluded categories IDs. |
| | 1380 | * @return string |
| | 1381 | */ |
| | 1382 | function get_next_post_link( $format = '« %link', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1383 | return get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_categories, false ); |
| | 1384 | } |
| | 1385 | |
| | 1386 | /** |
| 1364 | | function next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') { |
| 1365 | | adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, false); |
| | 1396 | function next_post_link( $format = '%link »', $link = '%title', $in_same_cat = false, $excluded_categories = '' ) { |
| | 1397 | echo get_next_post_link( $format, $link, $in_same_cat, $excluded_categories ); |
| | 1446 | * Display adjacent post link. |
| | 1447 | * |
| | 1448 | * Can be either next post link or previous. |
| | 1449 | * |
| | 1450 | * @since 2.5.0 |
| | 1451 | * @uses get_adjacent_post_link() |
| | 1452 | * |
| | 1453 | * @param string $format Link anchor format. |
| | 1454 | * @param string $link Link permalink format. |
| | 1455 | * @param bool $in_same_cat Optional. Whether link should be in a same category. |
| | 1456 | * @param array|string $excluded_categories Optional. Array or comma-separated list of excluded category IDs. |
| | 1457 | * @param bool $previous Optional, default is true. Whether to display link to previous or next post. |
| | 1458 | * @return string |
| | 1459 | */ |
| | 1460 | function adjacent_post_link( $format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true ) { |
| | 1461 | echo get_adjacent_post_link( $format, $link, $in_same_cat, $excluded_categories, $previous ); |
| | 1462 | } |
| | 1463 | |
| | 1464 | /** |