Customizer conflicts with Category Colors

Home Forums Calendar Products Events Calendar PRO Customizer conflicts with Category Colors

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1048285
    Andy Fragen
    Moderator

    Apparently the new Customizer option in The Events Calendar writes inline CSS to the footer which now overrides many elements of the Category Colors plugin. πŸ™

    <script type="text/css" id="tmpl-tribe_events_pro_customizer_css">

    Is there any way to clear the Customizer data or possibly generate an option using the Customizer output and then load that option using wp_enqueue_style

    Ask Barry how to do this as it’s what we do with Category Colors. πŸ˜‰

    As it stands there’s really no way to override this Customizer generated CSS.

    Please refer to https://github.com/moderntribe/events-pro/issues/256

    • This topic was modified 8 years, 4 months ago by Andy Fragen.
    • This topic was modified 8 years, 4 months ago by Andy Fragen.
    #1050576
    Barry
    Member

    Hey Andy!

    It’s possible to override it with a filter. For example, this code (if added to your theme’s functions.php file, or a custom plugin, etc) would essentially remove the customizer CSS:

    add_filter( 'tribe_events_pro_customizer_css_template', '__return_empty_string', 20 );

    Of course, you could do something a little more fine grained depending on the exact result you are after.

    With that said, I take your broader point and – setting transient based caching aside for the moment – possibly what we should really be doing here is leveraging wp_add_inline_style() when we inject the customizer styles. I’ll be sure to talk this through with the team and see if we can make a change along these lines πŸ™‚

    #1050760
    Andy Fragen
    Moderator

    Hey Barry,

    I was looking at the filter you mentioned, mostly with the thought of trying to alter the output, but as the CSS isn’t passed no joy there. I forgot about just eliminating all the CSS from the Customizer but that seems a bit heavy handed, though still a solution. Also, this would continue to create an empty inline style tag in the code. Not something I think we want. Perhaps a return statement in print_css_template() if $css_template is empty would make things much cleaner here.

    I like the idea of using wp_add_inline_style() as you should be able to add the Customizer CSS to whichever tribe stylesheet is used and this would then be able to be overwritten without changing our current practice.

    The only other concerning thing is that if the user ever adjusts something in The Events Calendar via the Customizer, there is no simple method for undoing this. Perhaps some other setting in the Customizer to revert all changes. Just thinking out loud.

    #1050816
    Barry
    Member

    Hi Andy,

    I was looking at the filter you mentioned, mostly with the thought of trying to alter the output, but as the CSS isn’t passed no joy there.

    Not quite sure what you were experiencing here … do you mean your filter function received an empty string (was your priority high enough if so)?

    I like the idea of using wp_add_inline_style() as you should be able to add the Customizer CSS to whichever tribe stylesheet is used and this would then be able to be overwritten without changing our current practice.

    Agreed! We’re going to review things and look at this approach.

    The only other concerning thing is that if the user ever adjusts something in The Events Calendar via the Customizer, there is no simple method for undoing this. Perhaps some other setting in the Customizer to revert all changes. Just thinking out loud.

    That’s a very valid point – I’ll be sure to log that!

    #1064518
    Joanna
    Participant

    Hi there,
    I was the person that raised the initial question in the The Events Calendar Category Colors forum and am also an Events Calendar Pro subscriber. I was wondering whether you have been able to come up with a solution to this issue yet?
    Many thanks,
    Jo

    #1064544
    Barry
    Member

    Hi Jo,

    Thanks for posting!

    Unfortunately I don’t have anything to report at this time and I’m afraid we can’t commit to any sort of timeframe for when this might happen.

    We’ve logged this for further consideration but further work has yet to commence, though I did update the report on our internal tracker to note your continued interest πŸ™‚

    In the interim I can only suggest an approach based on my first reply (above) as a way of working around any difficulties.

    #1079304
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

    #1241711
    Andy Fragen
    Moderator

    I believe I have fixed this issue in the latest version of The Events Calendar Category Colors.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Customizer conflicts with Category Colors’ is closed to new replies.