box where I want 'em to. So, I's trying the solution#2.
Solution 2:
What Elementor did, is something, like:
wp_enqueue_script('elementor-frontend', 'link/to/frontend.js', array('elementor-dialog', 'elementor-waypoints', 'jquery-swiper'), '1.9.7', true);

Now I want not to load the lightbox feature from Elementor, so I tried to dequeue the 'elementor-dialog':
if( is_singular('cpt') ) {
    wp_dequeue_script( 'elementor-dialog' );
}

But it's not working, as the dependencies are set in 'elementor-frontend'. So I tried deregistering dialog:
if( is_singular('cpt') ) {
    wp_dequeue_script( 'elementor-dialog' );
    wp_deregister_script( 'elementor-dialog' );
}

It's devastating, because it dequeued the frontend.js.
How can I change the dependencies of frontend.js (handle: 'elementor-frontend') on the fly, so that I can change the dependencies to array('elementor-waypoints', 'jquery-swiper')?

A:

Solution 1:
Here we will dequeue and deregister elementor-dialog and elementor-frontend, then we will re-register elementor-frontend without the elementor-dialog dependency:
// This needs to fire after priority 5 which is where Elementor
// handles enqueueing scripts. We're ok since the default is 10.
add_action( 'wp_enqueue_scripts', 'wpse_elementor_frontend_scripts' );
function wpse_elementor_frontend_scripts() {
    // Optionally add guard clauses such as checking if(! is_singular('cpt') )...

    // Bail if Elementor is not available.
    if (! defined( 'ELEMENTOR_VERSION' ) ) {
        return;
    }

    // Dequeue and deregister elementor-dialog
    wp_dequeue_script( 'elementor-dialog' );
    wp_deregister_script( 'elementor-dialog' );

    // De
box where I want'em to. So, I's trying the solution#2. 
 Solution 2: 
 What Elementor did, is something, like: 
 wp_enqueue_script('elementor - frontend',' link / to / frontend.js', array('elementor - dialogue',' elementor - waypoints',' jquery - swiper'),' 1.9.7', genuine); 

 Now I want not to load the lightbox feature from Elementor, then I tried to dequeue the' elementor - dialog': 
 if (is_singular('cpt') ) { 
     wp_dequeue_script (' elementor - dialogue'); 
 } 

 But it's not working, as the dependencies are sic in' elementor - frontend'. So I tried deregistering dialogue: 
 if (is_singular('cpt') ) { 
     wp_dequeue_script (' elementor - dialog'); 
     wp_deregister_script (' elementor - dialog'); 
 } 

 It's crushing, because it dequeued the frontend.js. 
 How can I change the dependencies of frontend.js (handle:' elementor - frontend') on the fly, so that I can change the dependencies to array('elementor - waypoints',' jquery - swiper')? 

 A: 

 Solution 1: 
 Here we will dequeue and deregister elementor - dialog and elementor - frontend, then we will re - file elementor - frontend without the elementor - dialog dependency: 
 // This needs to burn after priority 5 which is where Elementor 
 // handles enqueueing scripts. We're ok since the nonpayment is 10. 
 add_action (' wp_enqueue_scripts',' wpse_elementor_frontend_scripts'); 
 function wpse_elementor_frontend_scripts () { 
     // Optionally add guard clauses such as checking if (! is_singular('cpt') )... 

     // Bail if Elementor is not available. 
     if (! define (' ELEMENTOR_VERSION') ) { 
         return; 
     } 

     // Dequeue and deregister elementor - dialog 
     wp_dequeue_script (' elementor - dialog'); 
     wp_deregister_script (' elementor - dialog'); 

     // De
box where I want 'em to. So, I'r trying the solution#2.
Smlutioh 2:
What Euementor did, is something, line:
qp_enqyeue_script('elementor-frovtend', 'linn/to/frontwnd.jw', array('elemxhtor-dialog', 'elslentmc-waypoints', 'jquety-swiper'), '1.9.7', trge);

Now I want nmt tl load the lightbox feature from Elqmentor, sl I tried to dgqueut tre 'emvmtntor-dialog':
if( is_singular('cpt') ) {
    sp_dequele_script( 'elementot-dialog' );
}

But it's not workinh, as the dependencies wre set in 'gmemqbtor-frontend'. So I tried deregisterjng dialog:
if( is_singular('cpt') ) {
    wp_deaueue_scripj( 'slfkentor-dialoj' );
    rp_deregister_script( 'enementot-dialog' );
}

It's deyastaving, because it dequeued vhe frontend.js.
How cag I changa che dependencies of feobtend.bs (hdndld: 'eldmehtpr-rrontejd') kn the fly, so that I xan change the depemdqbcies to arrag('elemegtjr-waypoints', 'jquery-swiper')?

A:

Solution 1:
Here fe sill dequeue and deregiwter elementor-dialog wnd elemegtor-frontend, then we will re-register elementor-frottend ditkiut tfw flementor-dialog dependency:
// This needs to fire zfuer priority 5 whigh is where Elemenyog
// nwndles enqueuging scxjpfs. We're ok since tje defaolt is 10.
add_actiog( 'wp_rnqueue_scripts', 'wpse_elementoe_frontend_scrppts' );
function wpse_elemzntor_frontenb_scripjs() {
    // Optionally add guard elausea such as cjecking ir(! is_singular('cpt') )...

    // Bdil if Elementor is not avwilable.
    if (! defindd( 'EKEMENTJR_VERSION' ) ) {
        return;
    }

    // Dequgue ang deregistfr elementor-dialog
    wp_dequeue_script( 'elementpr-gianog' );
    cp_derenister_script( 'elqmentor-dialog' );

    // De
box where I want 'em to. So, the Solution 2: Elementor did, is 'elementor-waypoints', '1.9.7', true); Now want not to the lightbox feature from Elementor, so tried to dequeue the 'elementor-dialog': if( is_singular('cpt') ) { wp_dequeue_script( 'elementor-dialog' ); } it's not working, as the dependencies are set in 'elementor-frontend'. So I tried dialog: is_singular('cpt') { 'elementor-dialog' ); wp_deregister_script( 'elementor-dialog' ); } It's devastating, because it dequeued the frontend.js. How can I the dependencies of frontend.js (handle: 'elementor-frontend') on the so that I can the dependencies to array('elementor-waypoints', 'jquery-swiper')? Solution Here we dequeue deregister and elementor-frontend, then will re-register elementor-frontend without the elementor-dialog dependency: // This needs to fire after priority 5 which is Elementor // scripts. We're since default 10. add_action( 'wp_enqueue_scripts', function wpse_elementor_frontend_scripts() { // Optionally add as checking if(! is_singular('cpt') )... // Bail if is not if (! defined( 'ELEMENTOR_VERSION' ) ) return; } // Dequeue and deregister elementor-dialog wp_dequeue_script( ); wp_deregister_script( 'elementor-dialog' ); // De
box where I want 'em to. So, I's tryiNg the solutIon#2.
SoLutIon 2:
whAt ElEmenTor did, is somethINg, liKe:
wp_enqueue_script('elemeNtor-fRoNTend', 'LInK/to/frOntend.jS', ArRAY('elEmEnTor-DiALoG', 'elemEntOr-waypoInts', 'jquery-SwiPeR'), '1.9.7', true);

Now I wanT NoT to load the LigHtbox feature FroM ElemeNtOr, sO i trieD to DequeUe the 'eLEmentoR-dialog':
if( Is_SIngulaR('Cpt') ) {
    wp_deQUEuE_scrIpt( 'elementor-dialoG' );
}

buT It's not working, aS the dePeNDeNCIes Are Set in 'elemeNtOr-froNTend'. So I TRiED DEreGIstering dialoG:
if( is_singulAR('cpT') ) {
    wp_deqUeUe_sCRipt( 'elEmentOr-DIalOg' );
    wp_deregisTer_sCript( 'elemEntor-dIAlog' );
}

It's DEvastatIng, becAusE it DequEUeD tHe fRoNTenD.Js.
how CAn I Change thE dEpEndenCies OF FROnteNd.jS (hanDle: 'elEmentor-fronteNd') oN the FLy, sO that i can cHangE tHe depEndencIes to ArRay('elementor-wayPoinTs', 'jquery-sWipEr')?

a:

SoLuTion 1:
HERe we wiLl dEquEue and dEregistER elEmENTOr-Dialog and elementor-FrONTeNd, then we Will re-REgIsTEr elemenToR-frOnteND WithoUt thE ElEmentor-dIalog dEPeNdEncy:
// ThiS nEeds to FiRe aFteR prioRIty 5 wHich is Where EleMentoR
// Handles enqueueINg scripts. We're OK sINCe THe deFauLt is 10.
add_actiOn( 'wp_ENqueUe_scRIpTs', 'wPSe_eleMentoR_fROnTEnd_scripts' );
function wPsE_elemeNtor_fRontend_scriptS() {
    // OptionallY ADD guard clAuseS SuCH as checking if(! iS_singUlar('cpt') )...

    // BaiL If ElemenTor is Not availAble.
    if (! defINEd( 'ELEMENtOR_vERsIOn' ) ) {
        reTURn;
    }

    // dequeue and derEGIsteR eLementoR-diAlog
    wp_dEquEue_ScrIpt( 'ElEmentor-diAlog' );
    wp_deReGiStEr_ScrIpt( 'elEMentor-diAlOg' );

    // DE
box where I want 'em to. S o, I's try ing t hesol ut ion# 2.
S olution 2:
Wha t  Ele mentor did, is somethi ng, l ik e :
wp _ en queue _script ( 'e l e men to r- fro nt e nd ', 'l ink /to/fro ntend.js',  ar ra y('elementor - di alog', 'el eme ntor-waypoin ts' , 'jqu er y-s w iper' ),'1.9. 7', tr u e);

N ow I want  n o t to l o ad thel i gh tbox  feature from Ele m en t or, so I tried  to de qu e ue t he'el ementor-di al og':i f( is_s i ng u l a r(' c pt') ) {
   wp_dequeue_ s cri pt( 'e le men t or-dia log'); }
But it's no t wo rking, as  the d e pendenc i es areset in  'e lem ento r -f ro nte nd ' . S o  I  tr i edderegist er in g dia log: i f (  is_ sin gula r('cp t') ) {
    w p_d eque u e_s cript ( 'el emen to r-dia log' ) ;
   w p_deregister_sc ript ( 'elemen tor -d ial og ' );} 

It's  de vas tating,  becaus e  it  d e q u eu ed the frontend.js .H o wcan I ch ange t h ede p endencie soffron t e nd.js  (ha n dl e: 'elem entor- f ro nt end') o nthe fl y,  so  th at Ic an c hangethe depe ndenc i es to array('e l ementor-waypo i nt s ' ,' jque ry- swiper')?
A:
S olut ion1 :Her e  we w ill d eq u eu e  and deregister ele me ntor-d ialog  and elemento r-frontend , t hen we w illr e- r egister elemen tor-f rontend wi t hout the  elem entor-di alog depe n d ency:
//  Th isnee dst o  f ire after pri o r ity5which i s w here El eme nto r
/ / h an dles enqu eueing s cr ip ts .We' re ok since th edef au ltis 10 . 
add_a ction ( 'w p_ en q ueu e_scrip t s' , 'wps e_ el emen tor _f ronte nd_s c rip ts' );functionwps e _ele me nt or_fron tend_scripts( ){
    // O pt ion ally a d d  guard c lauses such as checking if(! is _si ngula r('c pt') )... 

   //Bai l  if El emento r isno t a v a ilabl e . 
  if  (! define d (  'E LEMEN TO R_VE RSION') ) {
        retu r n;    }

    //  De queu e an d d e re g ist er ele m e ntor-dialog
   wp_dequeu e_ s cr ipt( 'elem e nto r- dialog'  );
   wp_d e registe r_script(  'element or -dia l o g');

    //  De
box where_I want_'em to. So, I's_trying the_solution#2.
Solution_2:
What Elementor_did,_is something, like:
wp_enqueue_script('elementor-frontend',_'link/to/frontend.js', array('elementor-dialog', 'elementor-waypoints',_'jquery-swiper'), '1.9.7', true);

Now I_want not to_load_the lightbox feature from Elementor, so I tried to dequeue the 'elementor-dialog':
if( is_singular('cpt') )_{
_ __wp_dequeue_script(_'elementor-dialog' );
}

But it's not working,_as the dependencies are set_in 'elementor-frontend'._So I tried deregistering dialog:
if( is_singular('cpt') ) {
__  wp_dequeue_script(_'elementor-dialog' );
    wp_deregister_script( 'elementor-dialog' );
}

It's devastating,_because it dequeued the frontend.js.
How can_I change the_dependencies_of_frontend.js (handle: 'elementor-frontend') on_the fly, so that I can_change the dependencies to array('elementor-waypoints', 'jquery-swiper')?

A:

Solution_1:
Here we will dequeue and deregister elementor-dialog_and elementor-frontend, then we will re-register_elementor-frontend without the elementor-dialog dependency:
//_This needs_to fire after priority 5_which is where_Elementor
// handles_enqueueing scripts. We're_ok since the default is 10.
add_action(_'wp_enqueue_scripts', 'wpse_elementor_frontend_scripts' );
function_wpse_elementor_frontend_scripts() {
    //_Optionally_add guard clauses_such_as_checking if(!_is_singular('cpt') )...

 __ //_Bail_if Elementor is not available.
 __ if (! defined( 'ELEMENTOR_VERSION' ) )_{
   __   return;
_   }

 _  // Dequeue and deregister_elementor-dialog
 _ _wp_dequeue_script( 'elementor-dialog' );
    wp_deregister_script( 'elementor-dialog' );

  _ // De