multilanguage
1 year ago
recommendations
11 months ago
colibri.php
1 year ago
contact-form.php
1 year ago
entity.php
4 years ago
get-body-class.php
1 year ago
get-classic-page-template.php
1 year ago
get-page-query.php
1 year ago
get-page-title.php
1 year ago
get-post-content.php
1 year ago
get-post-styles.php
1 year ago
index.php
11 months ago
kubio-cloud.php
1 year ago
page-templates.php
4 years ago
save-template-parts-filter.php
1 year ago
subscribe-form.php
4 years ago
typekit.php
4 years ago
update-settings-flags.php
1 year ago
get-body-class.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | use Kubio\Core\Utils; |
| 4 | use IlluminateAgnostic\Arr\Support\Arr; |
| 5 | |
| 6 | add_action( |
| 7 | 'template_redirect', |
| 8 | function () { |
| 9 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 10 | if ( Arr::has( $_REQUEST, '__kubio-body-class' ) && Utils::canEdit() ) { |
| 11 | |
| 12 | $omit_classes = array( 'logged-in', 'admin-bar', 'no-customize-support', 'wp-custom-logo' ); |
| 13 | |
| 14 | $classes = array_diff( get_body_class(), $omit_classes ); |
| 15 | |
| 16 | remove_all_filters( 'body_class' ); |
| 17 | |
| 18 | return wp_send_json_success( |
| 19 | array( |
| 20 | 'bodyClass' => array_values( $classes ), |
| 21 | ) |
| 22 | ); |
| 23 | } |
| 24 | }, |
| 25 | PHP_INT_MAX |
| 26 | ); |
| 27 |