Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
wordpress deletes <sup> on save comment

I'm trying to implement an WYSIWYG editor to my WP comment section. I experience many difficulties with saving the HTML data in the WordPress database. WP strips many of the HTML tags automatically. I was able to restore the

tags trough the 'preprocess_comment' filter. I added the wpautop() filter to the content. Now the line breaks are appearing. But when I want to use the tag, WordPress deletes is too.

I use the Trumbowysiwyg js solution to replace the default comment textarea with the wysiwyg editor. When using the editor, the HTML code looks nice. It has all the HTML tags but after saving the comment, these tags are stripped. Can someone tell me how to allow HTML comments to be saved in the database?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

WordPress keeps a list of allowed tags which you can use in comments, surely you do not want users to post any html they want. So I suggest you edit the allowedtags so they will not be removed.

add_action('comment_post', 'allow_more_tags');

function allow_more_tags() {
   global $allowedtags;
   $allwedtags['sup'] = array('class'=>array());
} 

Like this you can add any tags you like and even allow certain classs to be added to them.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda