Changeset 3257073 for stockpack/trunk/src/class-stockpackmedia.php
- Timestamp:
- 03/17/2025 11:13:08 AM (13 months ago)
- File:
-
- 1 edited
-
stockpack/trunk/src/class-stockpackmedia.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
stockpack/trunk/src/class-stockpackmedia.php
r3185585 r3257073 94 94 } 95 95 96 $this-> enqueue_dialog_js();96 $this->register_dialog_js(); 97 97 98 98 wp_enqueue_script( $script, plugins_url( '/dist/js/' . $name, STOCKPACK_DIR ), array( … … 159 159 } 160 160 161 public function register_dialog_js() 162 { 163 if(wp_script_is('jquery-ui-dialog') === false) { 164 wp_register_script('jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog.min.js", array( 165 'jquery-ui-resizable', 166 'jquery-ui-draggable', 167 'jquery-ui-button', 168 'jquery-ui-position' 169 ), false, 1); 170 } 171 } 172 161 173 public function enqueue_admin_script_tag() { 162 174 echo '<script src="' . plugins_url( '/dist/js/stockpack-load-admin.js', STOCKPACK_DIR ) . '"></script>'; 163 175 } 176 177 public function enqueue_dialog_script_tag() { 178 echo '<script src="' . includes_url( '/js/jquery/ui/resizable.js' ) . '"></script>'; 179 echo '<script src="' . includes_url( '/js/jquery/ui/draggable.js' ) . '"></script>'; 180 echo '<script src="' . includes_url( '/js/jquery/ui/button.js' ) . '"></script>'; 181 echo '<script src="' . includes_url( '/js/jquery/ui/dialog.js' ) . '"></script>'; 182 } 183 184 public function enqueue_dialog_style_tag() { 185 echo '<link rel="stylesheet" href="' . includes_url( '/css/jquery-ui-dialog.css' ) . '"></style>'; 186 } 187 164 188 public function enqueue_admin_script_localization() { 165 189 $strings = $this->settings(array(),null); … … 212 236 } 213 237 214 if ( ( isset( $_GET['fl_builder'] ) ) ) { 238 if ( ( isset( $_GET['fl_builder'] ) )&& !isset($_GET['fl_builder_iframe']) ) { 239 add_action( 'wp_head', array( $this, 'enqueue_dialog_style_tag'), 100 ); 240 add_action( 'wp_footer', array( $this, 'enqueue_dialog_script_tag'), 100 ); 215 241 add_action( 'wp_footer', array( $this, 'enqueue_admin_script_tag' ), 100 ); 216 242 } … … 588 614 } 589 615 590 public function enqueue_dialog_js() { 591 if ( wp_script_is( 'jquery-ui-dialog' ) === false ) { 592 wp_register_script( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog.min.js", array( 593 'jquery-ui-resizable', 594 'jquery-ui-draggable', 595 'jquery-ui-button', 596 'jquery-ui-position' 597 ), false, 1 ); 598 } 599 } 616 617 618 public function enque_dialog_js() { 619 wp_enqueue_script( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog.min.js", array( 620 'media-editor', 621 ), false, 1 ); 622 } 623 624 600 625 601 626 private function getProviders()
Note: See TracChangeset
for help on using the changeset viewer.