Skip to main content

fc_before_substep_fields_{substep_id}

Type: Action

Fires before the fields inside a checkout substep.

The dynamic portion of the hook name, $substep_id, refers to the checkout substep ID. Additional hook names are created for substeps registered by other plugins. Possible hook names include:

  • fc_before_substep_fields_contact
  • fc_before_substep_fields_shipping_address
  • fc_before_substep_fields_shipping_method
  • fc_before_substep_fields_order_notes
  • fc_before_substep_fields_billing_address
  • fc_before_substep_fields_payment
  • fc_before_substep_fields_coupon_codes

Signature​

do_action( 'fc_before_substep_fields_{substep_id}', $step_id, $substep_id, $collapsible, $context );

Parameters​

NameTypeDescription
$step_idstringCheckout step ID.
$substep_idstringCheckout substep ID.
$collapsibleboolWhether the substep fields section is collapsible.
$contextstringContext in which the hook runs. Default checkout.

Since​

  • 3.1.3

Source: inc/checkout-steps.php

Examples​

In fc_before_substep_fields_{substep_id}, shipping_methods replaces {substep_id}.

add_action( 'fc_before_substep_fields_shipping_methods',
/**
* Add extra content before the sub-step contents.
*
* @param string $step_id Checkout step ID.
* @param string $substep_id Checkout substep ID.
* @param bool $collapsible Whether the substep fields section is collapsible.
* @param string $context Context in which the hook runs. Default checkout.
*/
function( $step_id, $substep_id, $collapsible, $context ) {
echo '<div>Custom content before sub-step fields.</div>';
},
10,
4
);