NO BUG: Filter to overwrite/extend CSS Selectors for "Theme Style > Link" doesn't work

I have followed the instructions in the following Bricks Academy post:

FILTER: BRICKS/LINK_CSS_SELECTORS

The documentation is from September 27, 2022, so I imagine someone here can help me.

In my child theme and paste:

add_filter( 'bricks/link_css_selectors', function( $link_css_selectors ) {
  $link_css_selectors[] = '.brxe-text-link';
  return $link_css_selectors;
} );

In my case I want to add the selector .brxe-text-link, which is added as a class to the “Text Link” element. I have also tried with :where(.brxe-text-link) and :where(a.brxe-text-link)

Unfortunately, I haven’t been able to get it to work. The styles configured for “Theme Style > Link” only apply for this selectors:

:where(.brxe-accordion .accordion-content-wrapper) a, :where(.brxe-icon-box .content) a, :where(.brxe-list) a, :where(.brxe-post-content) a:not(.bricks-button), :where(.brxe-posts .dynamic p) a, :where(.brxe-shortcode) a, :where(.brxe-tabs .tab-content) a, :where(.brxe-team-members) .description a, :where(.brxe-testimonials) .testimonial-content-wrapper a, :where(.brxe-text) a, :where(a.brxe-text), :where(.brxe-text-basic) a, :where(a.brxe-text-basic), :where(.brxe-post-comments) .comment-content a {

Searching the forum I found this topic from 2022 that is [SOLVED], but with a recent comment from 22 days ago that says:

Hi Thomas, this is not working with 1.9.6.1, any thoughts on how to fix it? Thanks

Does anyone know more about this? I’m not sure which version of Bricks the problem is in, but according to this comment it could be version 1.9.6.1

Thanks.

image

image

Hi Pablo,
Thanks so much for your report!

I reproduced the issue and added it to our bug tracker.

Best regards,
timmse

1 Like

Hi @ruffzen ,
Can you please change any setting in the theme styles and save to force its regeneration?

I think this is the cause I was able to replicate the issue initially: there was already a link style set before I added the filter. If I force the theme styles to regenerate by changing any value and saving, it works as expected.

Yes, that solution works.

Is possible to auto-regenerate theme styles after adding/modifying the filter ?
Or a button in some admin area, Bricks settings, etc.

No, unfortunately, that’s not possible.

I had the same issue: filter doesn’t seem to be applied. I checked back and forth all settings, plugin conflicts etc…

But then it’s “only” the style regeneration in Bricks Builder. To me, this behaviour is quite counter-intuitive. And reading the other comments about the filter, I’m not the only one.

From what I read, you don’t perceive this as a bug and won’t work on it. May I ask you at least to update the documentation (Filter: bricks/link_css_selectors – Bricks Academy, September 27, 2022)? Some fellow Bricks users will save hours.

1 Like