Forum Replies Created

Viewing 1 replies (of 1 total)
  • The problem lies in generating the call to Jcrop throughout the administration of wordpress , because one is called , but the libraries are not loaded , causing an error and stopping the loading of other script.

    The solution , if you use “simple responsive slide” is to modify the load script . it searches for the plugin folder and open the file “simple -responsive -slider – admin.php ” seeks the following snippet of code ( line 10 -43 ) :

    // Add script in <head> backend
            function load_script_admin() {
                $settings = get_option('simpleresponsiveslider_settings');
                $coord = get_option('simpleresponsiveslider_crop');
            ?>
                <script type="text/javascript">
                /**
                 * jClop
                 */
                jQuery(document).ready(function($) {
                    $(function(){
                        $('#cropbox').Jcrop({
                            minSize: [ <?php echo $settings['max_width']?>, <?php echo $settings['min_height']?>],
                            maxSize: [ <?php echo $settings['max_width']?>, <?php echo $settings['min_height']?> ],
                            allowResize: true,
                            setSelect:[ <?php echo $coord['x_'.$_GET['editor_image']];?>, <?php echo $coord['y_'.$_GET['editor_image']];?>, <?php echo $coord['x2_'.$_GET['editor_image']];?>, <?php echo $coord['y2_'.$_GET['editor_image']];?> ],
                            onSelect: updateCoords
                        });
                    });
    
                    function updateCoords(c)
                    {
                        $('#x').val(c.x);
                        $('#y').val(c.y);
                        $('#x2').val(c.x2);
                        $('#y2').val(c.y2);
                        $('#w').val(c.w);
                        $('#h').val(c.h);
                    };
                });
                </script>
            <?php
            }
            add_action('admin_head', 'load_script_admin');

    Once located , I cut that entire file, and now in the ” classes” folder, look for the ” options.php ” file and go to line 73 to find the function ” scripts ( ) ” on 86 lina are calls to the script and css jcrop , just add the code below just cut the other file.

    With this consegimos that only call plugin lanze when we really needed ( for the administration of the plugin and having the knowledge that there are dependencies) and not constantly causing errors in the administration and conflicts with other plugins.

    I hope I ‘ve been helpful to someone. A greeting.

Viewing 1 replies (of 1 total)