bp_nouveau_submit_button( string $action )
Output a submit button and the nonce for the requested action.
Description
Parameters
- $action
-
(Required) The action to get the submit button for. Required.
Source
File: bp-templates/bp-nouveau/includes/template-tags.php
2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 | function bp_nouveau_submit_button( $action ) { $submit_data = bp_nouveau_get_submit_button( $action ); if ( empty ( $submit_data [ 'attributes' ] ) || empty ( $submit_data [ 'nonce' ] ) ) { return ; } if ( ! empty ( $submit_data [ 'before' ] ) ) { /** * Fires before display of the submit button. * * This is a dynamic filter that is dependent on the "before" value provided by bp_nouveau_get_submit_button(). * * @since BuddyPress 3.0.0 */ do_action( $submit_data [ 'before' ] ); } $submit_input = sprintf( '<input type="submit" %s/>' , bp_get_form_field_attributes( 'submit' , $submit_data [ 'attributes' ] ) // Safe. ); // Output the submit button. if ( isset( $submit_data [ 'wrapper' ] ) && false === $submit_data [ 'wrapper' ] ) { echo $submit_input ; // Output the submit button into a wrapper. } else { printf( '<div class="submit">%s</div>' , $submit_input ); } if ( empty ( $submit_data [ 'nonce_key' ] ) ) { wp_nonce_field( $submit_data [ 'nonce' ] ); } else { wp_nonce_field( $submit_data [ 'nonce' ], $submit_data [ 'nonce_key' ] ); } if ( ! empty ( $submit_data [ 'after' ] ) ) { /** * Fires before display of the submit button. * * This is a dynamic filter that is dependent on the "after" value provided by bp_nouveau_get_submit_button(). * * @since BuddyPress 3.0.0 */ do_action( $submit_data [ 'after' ] ); } } |
Changelog
Version | Description |
---|---|
BuddyPress 3.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.