• Resolved simondeadly

    (@simondeadly)


    Hello,
    can you tell me how to remove this script from the frontend of the website

    <script type=”text/javascript”>
    /* <![CDATA[ */
    var strs_obj = {“be_restored”:”It will be restored.”,”can_recover”:”You can recover it from trash.”,”be_deleted”:”It will be deleted permanently.”,”you_sure”:”Are you sure?”,”Ignore_changes”:”It seems like you have made some changes in a repeater field. Ignore the changes?”};
    var ajax_script = {“ajaxurl”:”https:\/\/my-site-url\/wp-admin\/admin-ajax.php”,”nonce”:”010be23203″};
    var PANDA_PODS_REPEATER_PAGE_URL = “https:\/\/my-site-url\/wp-content\/plugins\/panda-pods-repeater-field\/fields\/pandarepeaterfield.php?page=panda-pods-repeater-field&”;
    var PANDA_PODS_REPEATER_URL = “https:\/\/my-site-url\/wp-content\/plugins\/panda-pods-repeater-field\/”;
    /* ]]> */
    </script>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Coding Panda

    (@codingpanda)

    Hi @simondeadly

    You can try the following code:

    
    class Alter_WP_Scripts extends WP_Scripts{
        function do_item( $handle, $group = false ){       
        	if( 'panda-pods-repeater-scripts' == $handle ){
        		$handle = false;
        	}
            return parent::do_item( $handle, $group );    	
        }
    }
    if( !is_admin() ){
    	add_action( 'wp_loaded', function() {
    	    $GLOBALS['wp_scripts'] = new Alter_WP_Scripts;
    	});
    }
    

    I tested the code and it works for the purpose on my testing site, but please double-check that it doesn’t cause any problems.

    Thanks for using the plugin.

    Thread Starter simondeadly

    (@simondeadly)

    Thank you it worked

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing script from frontend’ is closed to new replies.