Skip to:
Content

bbPress.org

Ticket #1656: is_edit.diff

File is_edit.diff, 2.9 KB (added by GautamGupta, 14 years ago)
  • bbp-common-functions.php

     
    699699 * ensure that it is properly set, such as in wp-config.php, for your
    700700 * environment. See {@link http://core.trac.wordpress.org/ticket/9235}
    701701 *
    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}
    703703 *
    704704 * @since bbPress (r2734)
    705705 *
    706706 * @param mixed $args Optional. If no args are there, then $_POST values are
    707707 *                     used.
    708  * @param bool $is_edit Optional. Is the topic/reply being edited? There are no
    709  *                       IP checks then.
    710708 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_name' with the
    711709 *                        anonymous user name
    712710 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_email' with the
    713711 *                        anonymous user email
    714  * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_ip' with the
    715  *                        anonymous user's ip address
    716712 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_author_website' with the
    717713 *                        anonymous user website
     714 * @uses apply_filters() Calls 'bbp_pre_anonymous_post_data' with all the
     715 *                        anonymous user's data
    718716 * @return bool|array False on errors, values in an array on success
    719717 */
    720 function bbp_filter_anonymous_post_data( $args = '', $is_edit = false ) {
     718function bbp_filter_anonymous_post_data( $args = '' ) {
    721719
    722720        // Assign variables
    723721        $defaults = array (
     
    913911        $post['user_ua'] = bbp_current_author_ua();
    914912
    915913        // Post title and content
    916         $post['title']   = $title;
    917         $post['content'] = $content;
     914        $post['title']   = $title;
     915        $post['content'] = $content;
    918916
    919917        /** Words *****************************************************************/
    920918
     
    937935
    938936                // Loop through post data
    939937                foreach( $post as $post_data ) {
    940 
     938
    941939                        // Check each user data for current word
    942940                        if ( preg_match( $pattern, $post_data ) ) {
    943 
     941
    944942                                // Post does not pass
    945943                                return false;
    946944                        }
     
    993991        $reply_id = bbp_get_reply_id( $reply_id );
    994992        $topic_id = bbp_get_topic_id( $topic_id );
    995993        $forum_id = bbp_get_reply_id( $forum_id );
    996 
     994
    997995        /** Reply *****************************************************************/
    998996
    999997        // Bail if reply is not published
     
    13611359                                                        'key'     => '_bbp_forum_id',
    13621360                                                        'value'   => $forum_id,
    13631361                                                        'compare' => '='
    1364                                                 ) );
     1362                                                ) );
    13651363                                        }
    13661364
    13671365                                        // Only forum replies
     
    15031501 * @global bbPress $bbp
    15041502 *
    15051503 * @see WP_Error()
    1506  *
     1504 *
    15071505 * @uses is_wp_error()
    15081506 * @usese WP_Error::get_error_codes()
    15091507 */
    15101508function bbp_has_errors() {
    15111509        global $bbp;
    1512 
     1510
    15131511        // Assume no errors
    15141512        $has_errors = false;
    15151513
     
    15191517
    15201518        // Filter return value
    15211519        $has_errors = apply_filters( 'bbp_has_errors', $has_errors, $bbp->errors );
    1522 
     1520
    15231521        return $has_errors;
    15241522}
    15251523