Changeset 4985 for trunk/includes/replies/template-tags.php
- Timestamp:
- 06/11/2013 04:42:26 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/includes/replies/template-tags.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/replies/template-tags.php
r4973 r4985 1685 1685 * @since bbPress (r2667) 1686 1686 * 1687 * @param mixed$args See {@link bbp_get_reply_admin_links()}1687 * @param array $args See {@link bbp_get_reply_admin_links()} 1688 1688 * @uses bbp_get_reply_admin_links() To get the reply admin links 1689 1689 */ 1690 function bbp_reply_admin_links( $args = '') {1690 function bbp_reply_admin_links( $args = array() ) { 1691 1691 echo bbp_get_reply_admin_links( $args ); 1692 1692 } … … 1696 1696 * @since bbPress (r2667) 1697 1697 * 1698 * @param mixed$args This function supports these arguments:1698 * @param array $args This function supports these arguments: 1699 1699 * - id: Optional. Reply id 1700 1700 * - before: HTML before the links. Defaults to … … 1718 1718 * @return string Reply admin links 1719 1719 */ 1720 function bbp_get_reply_admin_links( $args = '') {1720 function bbp_get_reply_admin_links( $args = array() ) { 1721 1721 1722 1722 // Parse arguments against default values … … 1732 1732 1733 1733 // If post is a topic, return the topic admin links instead 1734 if ( bbp_is_topic( $r['id'] ) ) 1734 if ( bbp_is_topic( $r['id'] ) ) { 1735 1735 return bbp_get_topic_admin_links( $args ); 1736 } 1736 1737 1737 1738 // If post is not a reply, return 1738 if ( !bbp_is_reply( $r['id'] ) ) 1739 if ( !bbp_is_reply( $r['id'] ) ) { 1739 1740 return; 1740 1741 // Make sure user can edit this reply 1742 if ( !current_user_can( 'edit_reply', $r['id'] ) ) 1741 } 1742 1743 // If topic is trashed, do not show admin links 1744 if ( bbp_is_topic_trash( bbp_get_reply_topic_id( $r['id'] ) ) ) { 1743 1745 return; 1744 1745 // If topic is trashed, do not show admin links 1746 if ( bbp_is_topic_trash( bbp_get_reply_topic_id( $r['id'] ) ) ) 1747 return; 1746 } 1748 1747 1749 1748 // If no links were passed, default to the standard … … 1759 1758 } 1760 1759 1761 // Check caps for trashing the topic1762 if ( !current_user_can( 'delete_reply', $r['id'] ) && !empty( $r['links']['trash'] ) )1763 unset( $r['links']['trash'] );1764 1765 1760 // See if links need to be unset 1766 1761 $reply_status = bbp_get_reply_status( $r['id'] ); … … 1768 1763 1769 1764 // Spam link shouldn't be visible on trashed topics 1770 if ( bbp_get_trash_status_id() == $reply_status ) {1765 if ( bbp_get_trash_status_id() === $reply_status ) { 1771 1766 unset( $r['links']['spam'] ); 1772 1767 1773 1768 // Trash link shouldn't be visible on spam topics 1774 } elseif ( isset( $r['links']['trash'] ) && ( bbp_get_spam_status_id() == $reply_status )) {1769 } elseif ( bbp_get_spam_status_id() === $reply_status ) { 1775 1770 unset( $r['links']['trash'] ); 1776 1771 } … … 1781 1776 $retval = $r['before'] . $links . $r['after']; 1782 1777 1783 return apply_filters( 'bbp_get_reply_admin_links', $retval, $r );1778 return apply_filters( 'bbp_get_reply_admin_links', $retval, $r, $args ); 1784 1779 } 1785 1780
Note: See TracChangeset
for help on using the changeset viewer.