multilanguage
1 year ago
colibri.php
2 years ago
contact-form.php
2 years ago
entity.php
4 years ago
get-body-class.php
4 years ago
get-classic-page-template.php
4 years ago
get-page-query.php
4 years ago
get-page-title.php
4 years ago
get-post-content.php
4 years ago
get-post-styles.php
4 years ago
index.php
1 year ago
kubio-cloud.php
2 years ago
page-templates.php
4 years ago
save-template-parts-filter.php
2 years ago
subscribe-form.php
4 years ago
typekit.php
4 years ago
update-settings-flags.php
1 year ago
get-body-class.php
26 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 | if ( Arr::has( $_REQUEST, '__kubio-body-class' ) && Utils::canEdit() ) { |
| 10 | |
| 11 | $omit_classes = array( 'logged-in', 'admin-bar', 'no-customize-support', 'wp-custom-logo' ); |
| 12 | |
| 13 | $classes = array_diff( get_body_class(), $omit_classes ); |
| 14 | |
| 15 | remove_all_filters( 'body_class' ); |
| 16 | |
| 17 | return wp_send_json_success( |
| 18 | array( |
| 19 | 'bodyClass' => array_values( $classes ), |
| 20 | ) |
| 21 | ); |
| 22 | } |
| 23 | }, |
| 24 | PHP_INT_MAX |
| 25 | ); |
| 26 |