Changeset 6921
- Timestamp:
- 11/07/2019 06:56:53 PM (6 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 4 edited
-
replies/capabilities.php (modified) (1 diff)
-
topics/capabilities.php (modified) (1 diff)
-
topics/template.php (modified) (2 diffs)
-
users/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/capabilities.php
r6783 r6921 154 154 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 155 155 156 // Only allow if not past the edit-lock period 157 $caps = ! bbp_past_edit_lock( $_post->post_date_gmt ) 158 ? array( $post_type->cap->edit_posts ) 159 : array( 'do_not_allow' ); 156 // If editing... 157 if ( bbp_is_reply_edit() ) { 158 159 // Only allow if not past the edit-lock period 160 $caps = ! bbp_past_edit_lock( $_post->post_date_gmt ) 161 ? array( $post_type->cap->edit_posts ) 162 : array( 'do_not_allow' ); 163 164 // Otherwise... 165 } else { 166 $caps = array( $post_type->cap->edit_posts ); 167 } 160 168 161 169 // Fallback to edit_others_posts. -
trunk/src/includes/topics/capabilities.php
r6783 r6921 174 174 } elseif ( ! is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) { 175 175 176 // Only allow if not past the edit-lock period 177 $caps = ! bbp_past_edit_lock( $_post->post_date_gmt ) 178 ? array( $post_type->cap->edit_posts ) 179 : array( 'do_not_allow' ); 176 // If editing... 177 if ( bbp_is_topic_edit() ) { 178 179 // Only allow if not past the edit-lock period 180 $caps = ! bbp_past_edit_lock( $_post->post_date_gmt ) 181 ? array( $post_type->cap->edit_posts ) 182 : array( 'do_not_allow' ); 183 184 // Otherwise... 185 } else { 186 $caps = array( $post_type->cap->edit_posts ); 187 } 180 188 181 189 // Unknown, so map to edit_others_posts -
trunk/src/includes/topics/template.php
r6903 r6921 3082 3082 // Trashed notice 3083 3083 case bbp_get_trash_status_id() : 3084 $notice_text = esc_html__( 'This topic is in the trash.', 'bbpress' ); 3084 $notice_text = esc_html__( 'This topic is in the trash.', 'bbpress' ); 3085 break; 3086 3087 // Pending notice 3088 case bbp_get_pending_status_id() : 3089 $notice_text = esc_html__( 'This topic is pending moderation.', 'bbpress' ); 3085 3090 break; 3086 3091 … … 3336 3341 // Topic has activity (could be from reply or topic author) 3337 3342 $last_active = bbp_get_topic_last_active_id( $topic_id ); 3338 if ( ! empty( $ last_active ) ) {3343 if ( ! empty( $vc_int ) && ! empty( $last_active ) ) { 3339 3344 $last_updated_by = bbp_get_author_link( array( 'post_id' => $last_active, 'size' => $r['size'] ) ); 3340 3345 $retstr = sprintf( esc_html__( 'This topic has %1$s, %2$s, and was last updated %3$s by %4$s.', 'bbpress' ), $reply_count, $voice_count, $time_since, $last_updated_by ); 3341 3346 3342 3347 // Topic has no replies 3343 } elseif ( ! empty( $v oice_count ) && ! empty( $reply_count ) ) {3348 } elseif ( ! empty( $vc_int ) && ! empty( $reply_count ) ) { 3344 3349 $retstr = sprintf( esc_html__( 'This topic has %1$s and %2$s.', 'bbpress' ), $voice_count, $reply_count ); 3345 3350 3346 3351 // Topic has no replies and no voices 3347 } elseif ( empty( $voice_count ) && empty( $reply_count ) ) { 3348 $retstr = sprintf( esc_html__( 'This topic has no replies.', 'bbpress' ), $voice_count, $reply_count ); 3352 } elseif ( empty( $vc_int ) && empty( $reply_count ) ) { 3353 $retstr = esc_html__( 'This topic has no replies.', 'bbpress' ); 3354 3355 // Topic is pending 3356 } elseif ( bbp_get_topic_status( $topic_id ) === bbp_get_pending_status_id() ) { 3357 $retstr = esc_html__( 'This topic is pending moderation.', 'bbpress' ); 3358 3359 // Fallback 3360 } else { 3361 $retstr = esc_html__( 'This topic is empty.', 'bbpress' ); 3349 3362 } 3350 3363 -
trunk/src/includes/users/template.php
r6868 r6921 2290 2290 2291 2291 // Looking at a single topic, topic is open, and forum is open 2292 } elseif ( ( bbp_is_single_topic() || is_page() || is_single() ) && bbp_is_topic_open() && bbp_is_forum_open() ) {2292 } elseif ( ( bbp_is_single_topic() || is_page() || is_single() ) && bbp_is_topic_open() && bbp_is_forum_open() && bbp_is_topic_published() ) { 2293 2293 $retval = bbp_current_user_can_publish_replies(); 2294 2294
Note: See TracChangeset
for help on using the changeset viewer.