Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » Bug in 1.6? Jquery is loaded in frontend.

  • Hi,

    After updating to Types 1.6 the layout of my site was screwed up. I’m using custom jQuery-UI styling.

    Since version 1.6, Types is including its jQuery-ui files into the frontend. I’m assuming Types just needs jQuery-ui for the admin?

    Seems like to me that loading the jQuery-ui is a bug? Can you please prevent your jQuery-ui files from being loaded in the frontend?

    Cheers,

    Koen

    https://wordpress.org/plugins/types/

Viewing 13 replies - 1 through 13 (of 13 total)
  • I have also found this issue this morning also. Maybe if this is not admin styling we should have an option to turn it off so we can style it ourselves.. These are the issues

    <link id="wptoolset-field-datepicker-css" media="all" type="text/css" href="http://siteaddress.co.uk/wp-content/plugins/types/embedded/common/toolset-forms/css/wpt-jquery-ui/datepicker.css?ver=0.1.1" rel="stylesheet">

    <link id="wptoolset-field-date-css" media="all" type="text/css" href="http://siteaddress.co.uk/wp-content/plugins/types/embedded/common/toolset-forms/css/wpt-jquery-ui/jquery-ui-1.9.2.custom.min.css?ver=0.1.1" rel="stylesheet">

    Problem is !is_admin() in line 34 in file types/embedded/common/toolset-forms/classes/class.date.scripts.php:

    if (
    //for front-end
    !is_admin() ||
    //for edit group pages
    ( ( isset($_GET['page']) && ($_GET['page'] == 'wpcf-edit-usermeta' || $_GET['page'] == 'wpcf-edit') ) ||
    ...

    If you don’t use wp-types datepicker in frontend, you could comment out the line like this (untested, no warranty):

    //for front-end
    // !is_admin() ||

    I have moved my css to be below the plugin generated one this makes it so my dominates. I though this a better solution than hacking the plugin.. I just moved wp_head() function above my themes css.

    Sorry about that, I will let our development team knows about that. Thank you for reporting that.

    Thanks for the quick fix Ov3rfly! That’ll surely help save some page load until it’s fixed in the core.

    Plugin Contributor brucepearson

    (@brucepearson)

    We’ve fixed the datepicker.css so it’s styling only applies to the datepicker popup.

    Please test with Types 1.6.1

    Hello!

    I have the same problem. Datepicker does nor work in another plugin.
    1.5.7 works fine…

    Also the same problem, and my datepicker stylesheet is below the types one, but it doesn’t override. I’m using types 1.6.2.

    I’ve updated to 1.6.2.

    The datepicker css en js are still loaded in the front-end…

    Same here. Please would be great not to enqueue jquery-ui and datepicker css / js files on frontend if we are not using them. Thank you!

    Open this file:
    \wp-content\plugins\types\embedded\common\toolset-forms\classes

    Starting on line 29, repalce with:

    public function __construct()
        {
            global $pagenow;
    		if (
                //for edit group pages
                (isset($_GET['page']) && ($_GET['page'] == 'wpcf-edit-usermeta' || $_GET['page'] == 'wpcf-edit')) ||
                //for edit pages including profile pages
                ($pagenow == 'profile.php' || $pagenow == 'post-new.php' || $pagenow == 'user-edit.php' || $pagenow == 'user-new.php' || $pagenow == 'post.php' || $pagenow == 'admin-ajax.php')
            ) {
                add_action( 'admin_enqueue_scripts', array( $this,'date_enqueue_scripts' ) );
    		}
    		$this->localization_slug = false;
        }

    Would prefer not to modify plugin core files as I will lose changes in the next update, but thank you very much for your directions! Hope Types team would fix this soon…

    Types datepicker.css seems to be causing problems in admin panel too if you’re using a datepicker in the admin edit screens. I am using Events Manager -plugin that has a hidden datepicker (hidden until input is activated) and Types datepicker.css seems to be messing styling of this feature (Types datepicker.css overrides styling of the Events Manager datepicker).

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Bug in 1.6? Jquery is loaded in frontend.’ is closed to new replies.