Support

Home Forums Event Espresso Premium JQuery UI CSS Not included correctly when using datepicker

JQuery UI CSS Not included correctly when using datepicker

Posted: March 12, 2017 at 6:51 am


grade

March 12, 2017 at 6:51 am

Hi,

We’ve just purchased your software and I’m setting up a project for a client using version 4.9.33.p., with WP 4.7.2 & PHP5.6.

I’m having problems with the datepicker being completely unstyled, and I think I know why…

When the datepicker is added to a form, your EE_Datepicker_Input.php is used, which on line 36 has the following…

wp_register_style( 'espresso-ui-theme', EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css', array(), EVENT_ESPRESSO_VERSION, TRUE );

As can be seen here (https://codex.wordpress.org/Function_Reference/wp_register_style), the final parameter to wp_register_style should be the media type string or nothing. Using TRUE causes the css output to be :

<link rel="stylesheet" id="espresso-ui-theme-css" href="/wp-content/plugins/event-espresso-core-reg/core/templates/global_assets/css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css?ver=4.9.33.p" type="text/css" media="1">

Of course media="1" is invalid, and so the css is not applied and the datepicker is completely unstyled.

Changing the wp_register_style calls last parameter to all (or simply removing it) fixes this and the styles are applied properly.


grade

March 12, 2017 at 7:02 am

Pull request : https://github.com/eventespresso/event-espresso-core/pull/214


Josh

  • Support Staff

March 13, 2017 at 3:22 pm

Thanks for the pull request, it’s been merged into master so it will be included in the next release.

The support post ‘JQuery UI CSS Not included correctly when using datepicker’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 2 years, 3 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!