Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant repeated CSS #1976

Open
kong0107 opened this issue Jan 16, 2025 · 0 comments
Open

Remove redundant repeated CSS #1976

kong0107 opened this issue Jan 16, 2025 · 0 comments

Comments

@kong0107
Copy link

Expected Behavior

CSS codes do not repeat.

Current Behavior

CSS codes are repeatedly written out
if there are more than one author box in one page
even when they may share same styles.

Image

Besides MA_Default_Layouts::renderBoxHTML may be called multiple times,
each shortcode would lead a <style> even when there's already the same CSS code.

Possible Solution

Check if the style codes have been added or enqueued before calling wp_add_inline_style and wp_enqueue_style.

Steps to Reproduce (for bugs)

Use more than one [publishpress_authors_box] in single page.

Context

HTML could and shall be less.

Your Environment

  • Version used: 4.7.3
  • Browser Name and version: MS Edge 131.0.2903.146
  • Operating System and version (desktop or mobile): Windows 11 24H2 on desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants