elementor
3 years ago
jet-appointment
3 years ago
jet-booking
3 years ago
jet-engine
3 years ago
jet-plugins-ajax
3 years ago
woocommerce
3 years ago
deprecated.php
3 years ago
deprecated.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Compatibility; |
| 5 | |
| 6 | |
| 7 | use Jet_Form_Builder\Blocks\Manager; |
| 8 | use Jet_Form_Builder\Plugin; |
| 9 | |
| 10 | class Deprecated { |
| 11 | |
| 12 | const HANDLE = 'jet-form-builder-deprecated'; |
| 13 | |
| 14 | public function __construct() { |
| 15 | add_filter( |
| 16 | 'jet-form-builder/before-start-form', |
| 17 | array( $this, 'add_deprecated_script' ) |
| 18 | ); |
| 19 | add_action( |
| 20 | 'wp_enqueue_scripts', |
| 21 | array( $this, 'register_scripts' ) |
| 22 | ); |
| 23 | add_action( |
| 24 | 'jet_plugins/frontend/register_scripts', |
| 25 | array( $this, 'register_scripts' ) |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | public function register_scripts() { |
| 30 | wp_register_script( |
| 31 | self::HANDLE, |
| 32 | Plugin::instance()->plugin_url( 'assets/js/frontend/deprecated{min}.js' ), |
| 33 | array(), |
| 34 | Plugin::instance()->get_version(), |
| 35 | true |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | public function add_deprecated_script( string $markup ): string { |
| 40 | wp_enqueue_script( self::HANDLE ); |
| 41 | |
| 42 | return $markup; |
| 43 | } |
| 44 | |
| 45 | } |