WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 9 months ago

#18330 closed enhancement (wontfix)

Add a Class functionality to wpautop()

Reported by: wpsmith Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

It would be nice to be able to add a class to <p> with wpauto as an optional arg.

Attachments (1)

wpautop.patch (2.3 KB) - added by wpsmith 7 years ago.

Download all attachments as: .zip

Change History (5)

@wpsmith
7 years ago

#1 @scribu
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Erm... no.

Instead of each paragraph having a class, wrap that particular group of paragraphs in a container and add a class to the container.

Then you can style the paragraphs just as easily.

#2 @wpsmith
7 years ago

Yea, that's what I thought as I though through it a bit more.

#3 @leec87
9 months ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

I respectfully disagree with @scribu, and think this is a valid argument to make.

If the user wanted to go along the Bootstrap route, and apply the lead class to paragraphs, it would need to be added directly to each p element, not a container that encases them.

I believe many people will want this patch to be added, including myself.

Please consider re-evaluating this?

https://getbootstrap.com/docs/3.3/css/#lead-body-copy

#4 @dd32
9 months ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

With no other requests in 6 years, I don't think this is a beneficial change to such a low-level function that's designed to be called as a filter on the_content & friends.

Adding the class to a wrapping element is how you'd do it with standard CSS/HTML, I don't think Bootstrap is enough of a use-case to add it here. While I can see the usage within some themes, if you're wanting to do things like this it seems likely that you'd be better off rolling an extra output filter on the text you're altering (such as only applying the change to the first <p> or similar element) or running the specific text you're changing through the various functions you want directly.

I'm re-closing this as wontfix pending more requests for the functionality.

Note: See TracTickets for help on using tickets.