Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/30/2018 04:55:10 PM (8 years ago)
Author:
imath
Message:

BP Nouveau Activity comment form: allow inputs to be added to the form

In BP Legacy, the hook bp_activity_entry_comments is fired inside the activity comment form, letting plugin developers inject custom inputs into this form. The same hook is also available in BP Nouveau but was misplaced out of the comment form.

To adapt to one of this Nouveau principle: try to avoid adding hooks directly into templates using existing template tags or specific wrappers and preserve the same level of customization plugin developers need, we will use the bp_nouveau_submit_button() template tag to wrap and fire this hook into its output.

Props sbrajesh

See #7839 (Trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress/activity/comment-form.php

    r12104 r12148  
    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>
Note: See TracChangeset for help on using the changeset viewer.