Support

Account

Home Forums Backend Issues (wp-admin) How to wrap each line in WYSIWYG editor in span when saving?

Solved

How to wrap each line in WYSIWYG editor in span when saving?

  • Is there a way to wrap all lines in a WYSIWYG editor in a span? I have a WYSIWYG editor in a custom field using the classic editor on an option page and I’m looking for a way to wrap each line in a span when saving.

    So for example, if I have this:

    Line 1
    Line 2
    Line 3

    Then when it saves, it does this

    <span>Line 1</span>
    <span>Line 2</span>
    <span>Line 3</span>

  • Isn’t each line in the WYSIWYG already wrapped in a <p> tag? Could you accomplish what you’re trying to do by targeting/styling the <p> tags instead of wrapping them in a <span>? What is your reason for wrapping in a <span>?

  • Nevermind, I figured out my problem and forgot to update.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘How to wrap each line in WYSIWYG editor in span when saving?’ is closed to new replies.