Skip to:
Content

BuddyPress.org

Ticket #7839: 7839.patch

File 7839.patch, 3.7 KB (added by imath, 7 years ago)
  • src/bp-templates/bp-nouveau/buddypress/activity/comment-form.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/comment-form.php src/bp-templates/bp-nouveau/buddypress/activity/comment-form.php
    index 0cd27f73f..f24c4dc4b 100644
    if ( ! bp_nouveau_current_user_can( 'comment_activity' ) || ! bp_activity_can_co 
    2020                        </label>
    2121                        <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input bp-suggestions" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
    2222                </div>
     23                <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
     24
    2325                <?php
     26                bp_nouveau_submit_button( 'activity-new-comment' );
    2427                printf(
    25                         '<input type="submit" name="ac_form_submit" value="%s" /> &nbsp; <button type="button" class="ac-reply-cancel">%s</button>',
    26                         esc_attr( _x( 'Post', 'button', 'buddypress' ) ),
     28                        '&nbsp; <button type="button" class="ac-reply-cancel">%s</button>',
    2729                        esc_html( _x( 'Cancel', 'button', 'buddypress' ) )
    2830                );
    2931                ?>
    30                 <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
    3132        </div>
    3233
    33         <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
    34 
    3534</form>
  • src/bp-templates/bp-nouveau/includes/activity/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/activity/template-tags.php src/bp-templates/bp-nouveau/includes/activity/template-tags.php
    index 1ae486249..8ccbfadb7 100644
    function bp_nouveau_activity_comment_action() { 
    699699 */
    700700function bp_nouveau_activity_comment_form() {
    701701        bp_get_template_part( 'activity/comment-form' );
    702 
    703         /**
    704          * Fires after the activity entry comment form.
    705          *
    706          * @since 1.5.0
    707          */
    708         do_action( 'bp_activity_entry_comments' );
    709702}
    710703
    711704/**
  • src/bp-templates/bp-nouveau/includes/functions.php

    diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php
    index 42853fb24..df8e4ccf2 100644
    function bp_nouveau_get_submit_button( $action = '' ) { 
    13331333                                'class' => 'auto',
    13341334                        ),
    13351335                ),
     1336                'activity-new-comment' => array(
     1337                        'after'     => 'bp_activity_entry_comments',
     1338                        'nonce'     => 'new_activity_comment',
     1339                        'nonce_key' => '_wpnonce_new_activity_comment',
     1340                        'wrapper'   => false,
     1341                        'attributes' => array(
     1342                                'name'  => 'ac_form_submit',
     1343                                'value' => _x( 'Post', 'button', 'buddypress' ),
     1344                        ),
     1345                ),
    13361346        ) );
    13371347
    13381348        if ( isset( $actions[ $action ] ) ) {
  • src/bp-templates/bp-nouveau/includes/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php
    index 9d33bbf2c..12f365675 100644
    function bp_nouveau_submit_button( $action ) { 
    24232423                do_action( $submit_data['before'] );
    24242424        }
    24252425
    2426         // Output the submit button.
    2427         printf(
    2428                 '<div class="submit">
    2429                         <input type="submit" %s/>
    2430                 </div>',
     2426        $submit_input = sprintf( '<input type="submit" %s/>',
    24312427                bp_get_form_field_attributes( 'submit', $submit_data['attributes'] )  // Safe.
    24322428        );
    24332429
    2434         wp_nonce_field( $submit_data['nonce'] );
     2430        // Output the submit button.
     2431        if ( isset( $submit_data['wrapper'] ) && false === $submit_data['wrapper'] ) {
     2432                echo $submit_input;
     2433
     2434        // Output the submit button into a wrapper.
     2435        } else {
     2436                printf( '<div class="submit">%s</div>', $submit_input );
     2437        }
     2438
     2439        if ( empty( $submit_data['nonce_key'] ) ) {
     2440                wp_nonce_field( $submit_data['nonce'] );
     2441        } else {
     2442                wp_nonce_field( $submit_data['nonce'], $submit_data['nonce_key'] );
     2443        }
    24352444
    24362445        if ( ! empty( $submit_data['after'] ) ) {
    24372446