Changeset 5177
- Timestamp:
- 11/23/2013 01:19:54 PM (12 years ago)
- Location:
- trunk/includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template.php
r5163 r5177 1580 1580 if ( bbp_is_reply_edit() ) : ?> 1581 1581 1582 <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php bbp_reply_title(); ?>" />1583 1582 <input type="hidden" name="bbp_reply_id" id="bbp_reply_id" value="<?php bbp_reply_id(); ?>" /> 1584 1583 <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" /> … … 1592 1591 else : ?> 1593 1592 1594 <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" />1595 1593 <input type="hidden" name="bbp_topic_id" id="bbp_topic_id" value="<?php bbp_topic_id(); ?>" /> 1596 1594 <input type="hidden" name="bbp_reply_to" id="bbp_reply_to" value="<?php bbp_form_reply_to(); ?>" /> -
trunk/includes/core/filters.php
r5132 r5177 94 94 add_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' ); 95 95 add_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' ); 96 97 // Reply title fallback 98 add_filter( 'the_title', 'bbp_get_reply_title_fallback', 1, 2 ); 96 99 97 100 // Prevent posting malicious or malformed content on new/edit topic/reply -
trunk/includes/replies/functions.php
r5055 r5177 275 275 // Filter and sanitize 276 276 $reply_title = apply_filters( 'bbp_new_reply_pre_title', $reply_title ); 277 278 // No reply title279 if ( empty( $reply_title ) )280 bbp_add_error( 'bbp_reply_title', __( '<strong>ERROR</strong>: Your reply needs a title.', 'bbpress' ) );281 277 282 278 /** Reply Content *********************************************************/ -
trunk/includes/replies/template.php
r5130 r5177 547 547 } 548 548 549 /** 550 * Get empty reply title fallback. 551 * 552 * @since bbPress (r5177) 553 * 554 * @param string $reply_title Required. Reply Title 555 * @param int $reply_id Required. Reply ID 556 * @uses bbp_get_reply_topic_title() To get the reply topic title 557 * @uses apply_filters() Calls 'bbp_get_reply_title_fallback' with the title and reply ID 558 * @return string Title of reply 559 */ 560 function bbp_get_reply_title_fallback( $post_title = '', $post_id = 0 ) { 561 562 // Bail if title not empty, or post is not a reply 563 if ( ! empty( $post_title ) || ! bbp_is_reply( $post_id ) ) { 564 return $post_title; 565 } 566 567 // Get reply topic title. 568 $topic_title = bbp_get_reply_topic_title( $post_id ); 569 570 // Get empty reply title fallback. 571 $reply_title = sprintf( __( 'Reply To: %s', 'bbpress' ), $topic_title ); 572 573 return apply_filters( 'bbp_get_reply_title_fallback', $reply_title, $post_id, $topic_title ); 574 } 575 549 576 /** 550 577 * Output the content of the reply … … 1580 1607 * @uses apply_filters() Calls 'bbp_get_reply_to_link' with the formatted link, 1581 1608 * the arguments array, and the reply 1582 * @return string Link for a reply to a reply 1609 * @return string Link for a reply to a reply 1583 1610 */ 1584 1611 function bbp_get_reply_to_link( $args = array() ) {
Note: See TracChangeset
for help on using the changeset viewer.