Automattic\WooCommerce\Internal\Admin\Settings
PaymentsController::add_body_classes
Adds body classes when in the Payments Settings admin area.
Method of the class: PaymentsController{}
No Hooks.
Returns
String. The modified body classes for the admin area.
Usage
$PaymentsController = new PaymentsController(); $PaymentsController->add_body_classes( $classes );
- $classes(string)
- The existing body classes for the admin area.
Default:''
PaymentsController::add_body_classes() PaymentsController::add body classes code WC 10.8.1
public function add_body_classes( $classes = '' ) {
global $current_tab;
// Bail if the type is invalid.
if ( ! is_string( $classes ) ) {
return $classes;
}
if ( 'checkout' === $current_tab && ! str_contains( 'woocommerce-settings-payments-tab', $classes ) ) {
$classes = "$classes woocommerce-settings-payments-tab";
}
return $classes;
}