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