cmb_frontend_form_format

The BuddyPress Profile Tabs cmb frontend form format hook.

Description

Parameters (4)

0. $form_class_cmb_form_method_post_id_s_enctype_multipart_form_data_encoding_multipart_form_data_input_type_hidden_name_object_id_value_s_s_input_type_submit_name_submit_cmb_value_s_class_button_primary_form — Optional. (string) => '
%s
'
The form class cmb form method post id s enctype multipart form data encoding multipart form data input type hidden name object id value s s input type submit name submit cmb value s class button primary form.
1. $object_id (unknown)
The object id.
2. $meta_box (unknown)
The meta box.
3. $form (unknown)
The form.

Usage

To run the hook, copy the example below.
  1. $form_class_cmb_form_method_post_id_s_enctype_multipart_form_data_encoding_multipart_form_data_input_type_hidden_name_object_id_value_s_s_input_type_submit_name_submit_cmb_value_s_class_button_primary_form = apply_filters( 'cmb_frontend_form_format', $form_class_cmb_form_method_post_id_s_enctype_multipart_form_data_encoding_multipart_form_data_input_type_hidden_name_object_id_value_s_s_input_type_submit_name_submit_cmb_value_s_class_button_primary_form, $object_id, $meta_box, $form ); 
  2.  
  3. if ( !empty( $form_class_cmb_form_method_post_id_s_enctype_multipart_form_data_encoding_multipart_form_data_input_type_hidden_name_object_id_value_s_s_input_type_submit_name_submit_cmb_value_s_class_button_primary_form ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the cmb_frontend_form_format callback 
  2. function filter_cmb_frontend_form_format( $form_class_cmb_form_method_post_id_s_enctype_multipart_form_data_encoding_multipart_form_data_input_type_hidden_name_object_id_value_s_s_input_type_submit_name_submit_cmb_value_s_class_button_primary_form, $object_id, $meta_box, $form ) { 
  3. // make filter magic happen here... 
  4. return $form_class_cmb_form_method_post_id_s_enctype_multipart_form_data_encoding_multipart_form_data_input_type_hidden_name_object_id_value_s_s_input_type_submit_name_submit_cmb_value_s_class_button_primary_form
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'cmb_frontend_form_format', 'filter_cmb_frontend_form_format', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'cmb_frontend_form_format', 'filter_cmb_frontend_form_format', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/admin/includes/CMBF/init.php  
  1. $form_format = apply_filters( 'cmb_frontend_form_format', '<form class="cmb-form" method="post" id="%s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%s">%s<input type="submit" name="submit-cmb" value="%s" class="button-primary"></form>', $object_id, $meta_box, $form );