WordPress.org

Ready to get started?Download WordPress

Forums

Category Grid View Gallery
I suggest you a fix on CatViewGrid.php (1 post)

  1. webEng
    Member
    Posted 6 months ago #

    Hi,
    I'm the developer of sliding youtube gallery, another wordpress plugin.
    I found out that when a user don't insert a shortcode for your plugin, the generated javascript cause an error. "paginateVal is not defined" That's because when this script runs (CatViewGrid.php) like this:

    function cg_init_js(){
            global $paginateVal;
            echo '<script type="text/javascript">';
    	echo 'paginateVal = '.$paginateVal.';';
    	echo '</script>';
    	do_action('cg_init_js');
    }

    If $paginateVal is null then user will have javascript error causing other plugin break. I suggest you to modify the script like this:

    function cg_init_js(){
            global $paginateVal;
    	if (empty($paginateVal)) {
    		$paginateVal = 0;
    	}
    	echo '<script type="text/javascript">';
    	echo 'paginateVal = '.$paginateVal.';';
    	echo '</script>';
    	do_action('cg_init_js');
    }

    Thank you.

    Luca

    http://wordpress.org/plugins/category-grid-view-gallery/

Reply

You must log in to post.

About this Plugin

About this Topic