Changeset 6320 for trunk/src/includes/users/template.php
- Timestamp:
- 02/26/2017 07:12:34 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/includes/users/template.php ¶
r6319 r6320 1037 1037 $paged = (bool) bbpress()->forum_query->in_the_loop; 1038 1038 } 1039 1039 1040 1040 // Pretty permalinks 1041 1041 if ( bbp_use_pretty_urls() ) { … … 1478 1478 * 1479 1479 * @param int $user_id Optional. User id 1480 * @uses bbp_get_ favorites_permalink() To get the favorites permalink1480 * @uses bbp_get_user_topics_created_url() To get the favorites permalink 1481 1481 */ 1482 1482 function bbp_user_topics_created_url( $user_id = 0 ) { … … 1490 1490 * @param int $user_id Optional. User id 1491 1491 * @uses bbp_get_user_profile_url() To get the user profile url 1492 * @uses apply_filters() Calls 'bbp_get_ favorites_permalink' with the1492 * @uses apply_filters() Calls 'bbp_get_user_topics_created_url' with the 1493 1493 * user profile url and user id 1494 1494 * @return string Permanent link to user profile page … … 1526 1526 } 1527 1527 1528 /** Topics Created ************************************************************/1528 /** Replies Created ************************************************************/ 1529 1529 1530 1530 /** … … 1534 1534 * 1535 1535 * @param int $user_id Optional. User id 1536 * @uses bbp_get_ favorites_permalink() To get the favorites permalink1536 * @uses bbp_get_user_replies_created_url() To get the favorites permalink 1537 1537 */ 1538 1538 function bbp_user_replies_created_url( $user_id = 0 ) { … … 1546 1546 * @param int $user_id Optional. User id 1547 1547 * @uses bbp_get_user_profile_url() To get the user profile url 1548 * @uses apply_filters() Calls 'bbp_get_ favorites_permalink' with the1548 * @uses apply_filters() Calls 'bbp_get_user_replies_created_url' with the 1549 1549 * user profile url and user id 1550 1550 * @return string Permanent link to user profile page … … 1580 1580 1581 1581 return apply_filters( 'bbp_get_user_replies_created_url', $url, $user_id ); 1582 } 1583 1584 /** Engagements ***************************************************************/ 1585 1586 /** 1587 * Output the link to the user's engagements 1588 * 1589 * @since 2.6.0 bbPress (r6320) 1590 * 1591 * @param int $user_id Optional. User id 1592 * @uses bbp_get_user_engagements_url() To get the engagements permalink 1593 */ 1594 function bbp_user_engagements_url( $user_id = 0 ) { 1595 echo esc_url( bbp_get_user_engagements_url( $user_id ) ); 1596 } 1597 /** 1598 * Return the link to the user's engagements 1599 * 1600 * @since 2.6.0 bbPress (r6320) 1601 * 1602 * @param int $user_id Optional. User id 1603 * @uses bbp_get_user_profile_url() To get the user profile url 1604 * @uses apply_filters() Calls 'bbp_get_user_engagements_url' with the 1605 * user profile url and user id 1606 * @return string Permanent link to user profile page 1607 */ 1608 function bbp_get_user_engagements_url( $user_id = 0 ) { 1609 1610 // Use displayed user ID if there is one, and one isn't requested 1611 $user_id = bbp_get_user_id( $user_id ); 1612 if ( empty( $user_id ) ) { 1613 return false; 1614 } 1615 1616 // Allow early overriding of the profile URL to cut down on processing 1617 $early_url = apply_filters( 'bbp_pre_get_user_engagements_url', $user_id ); 1618 if ( is_string( $early_url ) ) { 1619 return $early_url; 1620 } 1621 1622 // Get user profile URL 1623 $profile_url = bbp_get_user_profile_url( $user_id ); 1624 1625 // Pretty permalinks 1626 if ( bbp_use_pretty_urls() ) { 1627 $url = trailingslashit( $profile_url ) . bbp_get_user_engagements_slug(); 1628 $url = user_trailingslashit( $url ); 1629 1630 // Unpretty permalinks 1631 } else { 1632 $url = add_query_arg( array( 1633 bbp_get_user_engagements_rewrite_id() => '1', 1634 ), $profile_url ); 1635 } 1636 1637 return apply_filters( 'bbp_get_user_engagements_url', $url, $user_id ); 1582 1638 } 1583 1639
Note: See TracChangeset
for help on using the changeset viewer.