Changeset 6529 for trunk/src/includes/topics/functions.php
- Timestamp:
- 06/12/2017 05:41:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r6516 r6529 944 944 if ( empty( $forum_id ) ) { 945 945 $forum_id = bbp_get_topic_forum_id( $topic_id ); 946 947 // Make every effort to get forum id948 // https://bbpress.trac.wordpress.org/ticket/2529949 if ( empty( $forum_id ) && ( current_filter() === 'bbp_deleted_topic' ) ) {950 $forum_id = get_post_field( 'post_parent', $topic_id );951 }952 946 } 953 947 … … 2983 2977 function bbp_update_topic_voice_count( $topic_id = 0 ) { 2984 2978 2985 // Get the old voices 2979 // If it's a reply, then get the parent (topic id) 2980 $topic_id = bbp_is_reply( $topic_id ) 2981 ? bbp_get_reply_topic_id( $topic_id ) 2982 : bbp_get_topic_id( $topic_id ); 2983 2984 // Bail if no topic ID 2985 if ( empty( $topic_id ) ) { 2986 return; 2987 } 2988 2989 // Count the engagements 2986 2990 $count = count( bbp_get_topic_engagements( $topic_id ) ); 2987 2991 … … 3874 3878 * Called after deleting a topic 3875 3879 * 3880 * @since 2.0.0 bbPress (r2993) 3881 * 3876 3882 * @uses bbp_get_topic_id() To get the topic id 3877 3883 * @uses bbp_is_topic() To check if the passed id is a topic … … 3891 3897 * Called after trashing a topic 3892 3898 * 3899 * @since 2.0.0 bbPress (r2993) 3900 * 3893 3901 * @uses bbp_get_topic_id() To get the topic id 3894 3902 * @uses bbp_is_topic() To check if the passed id is a topic … … 3907 3915 /** 3908 3916 * Called after untrashing a topic 3917 * 3918 * @since 2.0.0 bbPress (r2993) 3909 3919 * 3910 3920 * @uses bbp_get_topic_id() To get the topic id
Note: See TracChangeset
for help on using the changeset viewer.