Home>Support>How i can update post content programmatically

How i can update post content programmatically

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi
i want to get content widget from post use gutenberg and update
how i can do that !??

thanks

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 4 years, 10 months ago Alex S
    Hi, I Work Here

    Hi Amine,

    This is possible, but it’s quite a complicated process to achieve. We’re unfortunately only able to provide a limited outline due to the complexity of this task. If you’re not very familiar with PHP, I recommend hiring a developer to assist you with this. We recommend using Codeable.

    To do this you’ll need to:

    Get the post content of the page you wish to update programmatically.
    Parse and filter the blocks added to the content until you find the SiteOrigin Layout block.
    Process the raw layout of the block and then iterate that layout until you find your widget.
    Make your desired changes, and then save the layout (here’s an example of how to do this).
    For SEO reasons, you should update the SO Layout Attribute.

    Kind regards,
    Alex

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More