Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

74
Vistas
Rich Texts Not saved the Data

i got issues in Saving Data in Rich Texts .. I already make the setAttributes for each attribute and have no changes too ! it is my code

attributes

attributes :{
    titleONEHOMEPorT: {
        type: "string",
        source: "html",
        selector: "h2",
      },
      titleTwoHOMEPorT: {
        type: "string",
        source: "html",
        selector: "h2",
      },
},

'Attributes and setAttributes'

 const {titleONEHOMEPorT , titleTwoHOMEPorT} = attributes;
            function onChangeTitleOnePort(newporttitone) { setAttributes({ titleONEHOMEPorT: newporttitone }); }
           

and this is the rich text in return

                            <RichText  key="editable" tagName="h2"  placeholder="اخر" value={titleONEHOMEPorT} onChange={onChangeTitleOnePort} />

And there's no thing shows in Console .. and not stored in DB Too

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The RichText component requires saving the content in save() with <RichText.Content ... />. By implementing the save() function to return null, the content is not saved into HTML. The way the RichText component works is by using the selector set in attributes to parse content from the saved source (HTML). If there is no content saved into the post content as HTML, nothing can load.

Using the PHP render_callback for dynamic blocks is intended for dynamic content. As you mention this is your current approach, if you are using PHP to do some dynamic string replacement or something similiar, perhaps what you could try instead is using the_content hook to alter the content after its retrieved from the database but before its displayed on the frontend. By using this approach, you can implement the required save() function for RichText to work and have the content saved and edited via the Editor while making full use of RichText features.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda