wc.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | // |
| 4 | // ─── DISABLE AUTOMATIC REQUIRED PAGE CREATION ─────────────────────────────────── |
| 5 | // |
| 6 | |
| 7 | add_filter( 'woocommerce_create_pages', 'auxin_disable_automatic_page_creation', 1, 1 ); |
| 8 | function auxin_disable_automatic_page_creation( $pages ) { |
| 9 | if ( ! empty( $_GET['action'] ) && $_GET['action'] == 'install_pages' ) { |
| 10 | return $pages; |
| 11 | } |
| 12 | return []; |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Preload customizer controls script because of an issue with global color and typography controller |
| 17 | * |
| 18 | * @return void |
| 19 | */ |
| 20 | function auxin_preload_customizer_controls_script() { |
| 21 | if (function_exists('WC')) { |
| 22 | $handle = 'load-custom-controls'; |
| 23 | wp_register_script( $handle, false, array( 'auxin_plugins', 'auxin_script' ), AUXELS_VERSION, false ); |
| 24 | wp_enqueue_script( $handle ); |
| 25 | } |
| 26 | } |
| 27 | add_action('customize_controls_init', 'auxin_preload_customizer_controls_script'); |
| 28 | ?> |