Changeset 6528 for trunk/src/includes/replies/template.php
- Timestamp:
- 06/12/2017 05:29:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/template.php
r6526 r6528 1571 1571 */ 1572 1572 function bbp_get_reply_topic_id( $reply_id = 0 ) { 1573 1574 // Assume there is no topic id1575 $topic_id = 0;1576 1577 // Check that reply_id is valid1578 1573 $reply_id = bbp_get_reply_id( $reply_id ); 1579 if ( ! empty( $reply_id ) ) { 1574 $topic_id = get_post_field( 'post_parent', $reply_id ); 1575 1576 // Meta-data fallback 1577 if ( empty( $topic_id ) ) { 1580 1578 $topic_id = get_post_meta( $reply_id, '_bbp_topic_id', true ); 1581 if ( ! empty( $topic_id ) ) { 1582 $topic_id = bbp_get_topic_id( $topic_id ); 1583 } 1584 } 1585 1586 // Filter & return 1587 return (int) apply_filters( 'bbp_get_reply_topic_id', $topic_id, $reply_id ); 1579 } 1580 1581 // Filter 1582 if ( ! empty( $topic_id ) ) { 1583 $topic_id = bbp_get_topic_id( $topic_id ); 1584 } 1585 1586 // Filter & return 1587 return (int) apply_filters( 'bbp_get_reply_topic_id', (int) $topic_id, $reply_id ); 1588 1588 } 1589 1589 … … 1612 1612 */ 1613 1613 function bbp_get_reply_forum_id( $reply_id = 0 ) { 1614 1615 // Assume there is no forum1616 $forum_id = 0;1617 1618 // Check that reply_id is valid1619 1614 $reply_id = bbp_get_reply_id( $reply_id ); 1620 if ( ! empty( $reply_id ) ) { 1615 $forum_id = get_post_field( 'post_parent', bbp_get_reply_topic_id( $reply_id ) ); 1616 1617 // Meta-data fallback 1618 if ( empty( $forum_id ) ) { 1621 1619 $forum_id = get_post_meta( $reply_id, '_bbp_forum_id', true ); 1622 if ( ! empty( $forum_id ) ) { 1623 $forum_id = bbp_get_forum_id( $forum_id ); 1624 } 1620 } 1621 1622 // Filter 1623 if ( ! empty( $forum_id ) ) { 1624 $forum_id = bbp_get_forum_id( $forum_id ); 1625 1625 } 1626 1626
Note: See TracChangeset
for help on using the changeset viewer.