Skip to main content

fc_checkout_body_custom_attributes

Type: Filter

Filters custom attributes added to the checkout body element.

Signature​

apply_filters( 'fc_checkout_body_custom_attributes', $attributes );

Parameters​

NameTypeDescription
$attributesarrayHTML attributes as an associative array. Default empty array.

Since​

  • 3.0.3

Source: templates/compat/themes/dt-the7/checkout-page-template/checkout/page-checkout-header.php

Examples​

Currently does not accept class attributes.

add_filter( 'fc_checkout_body_custom_attributes',
/**
* Add custom body attributes for theme compatibility.
*
* @param array $attributes HTML attributes as an associative array. Default empty array.
* @return array Filtered value.
*/
function( $attributes ) {
// Add other attributes (not class)
$attributes['data-custom'] = 'custom-value';

return $attributes;
},
10
);