Ticket #1656: is_edit.diff
| File is_edit.diff, 2.9 KB (added by , 14 years ago) |
|---|
-
bbp-common-functions.php
699 699 * ensure that it is properly set, such as in wp-config.php, for your 700 700 * environment. See {@link http://core.trac.wordpress.org/ticket/9235} 701 701 * 702 * If there are any errors, those are directly added to {@link bbPress: errors}702 * If there are any errors, those are directly added to {@link bbPress::errors} 703 703 * 704 704 * @since bbPress (r2734) 705 705 * 706 706 * @param mixed $args Optional. If no args are there, then $_POST values are 707 707 * used. 708 * @param bool $is_edit Optional. Is the topic/reply being edited? There are no709 * IP checks then.710 708 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_name' with the 711 709 * anonymous user name 712 710 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_email' with the 713 711 * anonymous user email 714 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_ip' with the715 * anonymous user's ip address716 712 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_website' with the 717 713 * anonymous user website 714 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_data' with all the 715 * anonymous user's data 718 716 * @return bool|array False on errors, values in an array on success 719 717 */ 720 function bbp_filter_anonymous_post_data( $args = '' , $is_edit = false) {718 function bbp_filter_anonymous_post_data( $args = '' ) { 721 719 722 720 // Assign variables 723 721 $defaults = array ( … … 913 911 $post['user_ua'] = bbp_current_author_ua(); 914 912 915 913 // Post title and content 916 $post['title'] = $title; 917 $post['content'] = $content; 914 $post['title'] = $title; 915 $post['content'] = $content; 918 916 919 917 /** Words *****************************************************************/ 920 918 … … 937 935 938 936 // Loop through post data 939 937 foreach( $post as $post_data ) { 940 938 941 939 // Check each user data for current word 942 940 if ( preg_match( $pattern, $post_data ) ) { 943 941 944 942 // Post does not pass 945 943 return false; 946 944 } … … 993 991 $reply_id = bbp_get_reply_id( $reply_id ); 994 992 $topic_id = bbp_get_topic_id( $topic_id ); 995 993 $forum_id = bbp_get_reply_id( $forum_id ); 996 994 997 995 /** Reply *****************************************************************/ 998 996 999 997 // Bail if reply is not published … … 1361 1359 'key' => '_bbp_forum_id', 1362 1360 'value' => $forum_id, 1363 1361 'compare' => '=' 1364 ) ); 1362 ) ); 1365 1363 } 1366 1364 1367 1365 // Only forum replies … … 1503 1501 * @global bbPress $bbp 1504 1502 * 1505 1503 * @see WP_Error() 1506 * 1504 * 1507 1505 * @uses is_wp_error() 1508 1506 * @usese WP_Error::get_error_codes() 1509 1507 */ 1510 1508 function bbp_has_errors() { 1511 1509 global $bbp; 1512 1510 1513 1511 // Assume no errors 1514 1512 $has_errors = false; 1515 1513 … … 1519 1517 1520 1518 // Filter return value 1521 1519 $has_errors = apply_filters( 'bbp_has_errors', $has_errors, $bbp->errors ); 1522 1520 1523 1521 return $has_errors; 1524 1522 } 1525 1523