multilanguage
1 year ago
recommendations
6 days 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-classic-page-template.php
21 lines
| 1 | <?php |
| 2 | |
| 3 | use Kubio\Core\Utils; |
| 4 | use IlluminateAgnostic\Arr\Support\Arr; |
| 5 | |
| 6 | add_filter( |
| 7 | 'template_include', |
| 8 | function ( $template ) { |
| 9 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 10 | if ( Arr::has( $_REQUEST, '__kubio-classic-page-template-slug' ) && Utils::canEdit() ) { |
| 11 | $slug = str_replace( wp_normalize_path( get_stylesheet_directory() ), '', wp_normalize_path( $template ) ); |
| 12 | $slug = str_replace( wp_normalize_path( get_template_directory() ), '', wp_normalize_path( $slug ) ); |
| 13 | $slug = str_replace( '.php', '', trim( $slug, '/' ) ); |
| 14 | return wp_send_json_success( $slug ); |
| 15 | } |
| 16 | |
| 17 | return $template; |
| 18 | }, |
| 19 | PHP_INT_MAX |
| 20 | ); |
| 21 |