V
V
Vladimir Novitsky2016-04-04 21:55:46
PHP
Vladimir Novitsky, 2016-04-04 21:55:46

How to change default generated tags in WordPress editor?

Hello.
There is such a problem. The WP visual editor generates specific tags for text, images, and more.
How can I override them?
For example, if it displays on the page when inserting an image:

<div>
  <p><a href="#"><img src="#" alt="" width="900" height="563"></a></p>

  <p>Описание</p>
</div>

and I need:
<figure>
  <a href="#"><img src="#" alt="" width="900" height="563"></a>

  <figcaption>Описание</figcaption>
</figure>

PS If I somehow unclearly formulated the question, ask.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evanre, 2016-04-14
@Evanre

You should dig in this direction:
str_replace , str_replace , preg_replace , wpautop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question