Ecommerce Shopify WordPress Discussion

How to get and edit a WordPress Navigation block in code?

I created a Navigation block named 'Main' for my header menu. I need to create a plugin that can fetch this block and add or remove elements from it. I used to call the wp_get_nav_menu_object() function to gather my menu, but with the new Wordpress version this does not work anymore since the navigation post type is not the same now. I found that the content of the menu is the stored in one variable as a string in the database. (In wp_posts -> post_content) Am I supposed to modify the whole content string if I want to edit my navigation from code ?
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.