Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

73
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!