When using the Gutenberg Block editor you need to use different hooks to get the expected behavior.
rest_insert_{$this->post_type}The pre-update hook.rest_after_insert_{$this->post_type}The post-update hook.
credits: @SallyCJ
Related Posts:
- WordPress 4.4+ breaks Walker Extension
- Gutenberg Editor: dynamicaly change slug field with an ACF field
- How to edit the slug/permalink in Gutenberg?
- How can I get this custom post type permalink structure? %custom_post_type%-%taxonomy%-%term-postname%
- Gutenberg output URL to post from attribute with post ID
- Relative links in Gutenberg
- Add post overwriting permalink from previous post in 4.6
- Gutenberg Editor: dynamically edit slug field based on ACF field
- MySQL-inserted custom taxonomy term lead to 404, flush rewrites doesn’t help
- Generate post title and permalink from custom field and post date
- Error: “Sorry, this content could not be embedded” when using the Embed block
- UI does not show correct Slug after modified using save_post action
- Need help with add_rewrite_rule
- Removing Parent Page(s) from Permalink
- Prevent WordPress from abbreviating-long-slugs…-in-the-admin
- Page begins with number, WordPress adds 2
- Why don’t WordPress post slugs allow accents?
- Multi-language permalink in qtranslate
- Modify get_permalink with a specific filter
- Include Taxonomy slug in post url
- Nice RSS Feed URLs for each custom post type
- How to set permalink to fetch all children custom posts with parent post in wordpress?
- Rewrite url / permalink for default archive – yearly / monthly
- Should I use relative or absolute urls when pointing to internal pages
- WordPress on VirtualBox – no pretty permalinks
- permalinks has -2 with post name structure. why?
- How can I change permalinks to use a different domain and path from where the blog is hosted?
- Child pages with same slug
- Permalinks, Rewrites, Get Variables, Oh My!
- Apostrophe in permalink results in page not found
- How to generate random numeric slugs for a custom post type?
- WP Site in subdirectory Joomla! Site – Permalinks not working
- How to get full content including template HTML
- I copied my site to another site but all links point to old site
- WordPress on Ubuntu 12.10: permalinks problem
- wordpress api using rest_route for other pages
- Infinite redirects after changing the permalink of a page
- Permalinks settings page blank
- Remove custom taxonomy base from URL
- How to have extra permalink for posts
- Trouble with numeric permalinks after 4.3.1
- Editing Pages Give 404 Error After WordPress Upgrade in Admin Panel
- How to get post object on blog template
- WordPress auto generates small medium and large of an image on upload, how can we guess their links?
- Error updating pages, and linking to pages (permalink error)
- Plain to postname permalinks not working
- Permalinks dropping after 3-4 weeks with no changes in theme or plugins
- WordPress Sub domain
- How can i have a custom post type with more slugs for each post?
- Create a PHP page to refresh the permalink on a custom table
- Google webmaster duplicate url issue with /page/01 /page/400
- URL rewriting: removing the site’s basename for a specific category
- Migrated from Windows to Linux. Any bulk methods for fixing case sensitivity?
- Unable to get /%postname%/ permalinks working, 404 on all links
- Permalink structure between 2 custom post types and a taxonomy
- Default permalink changes
- WordPress Permalink feature alternative
- How can I emulate permalink behaviour on static pages
- Unique one time use URL
- Media/attachment urls don’t redirect with fake URL structure
- when I create a page with a /blog permalink the css gets messed up
- how to prefer static page if it exists over wordpress page
- Remove a link from a page ID used within an array [closed]
- Get Posts Based on Tag Matching Page Title
- Passing variable as permalink URL
- “set_front” => false on custom post type breaks wp_list_categories links [closed]
- Customizing a permalink
- post preview/thumbnails not displaying correctly- linking to “home” instead of post?
- Moving blog and maintaining current permalinks
- All pages load the home page if pretty permalinks are used
- where can i see wordpress automatic redirect History
- WordPress keeps removing query var from the URL
- How can I access to the same post-type “page” from multiple different urls?
- Multiple URL rewrite rules and get every prams
- WordPress url customization
- permalink not showing correctly using wp_insert_post and post_name
- 404 error on published page with specific permalink
- Changing category base breaks permalinks
- Added .html to Woocommerce permalink but pagination don’t work!
- Subpages getting a 404 error after changing Parent page URL
- Updating wordpress permalinks to use https://
- WordPress Pagination Custom Rewrite Rule for Pages
- Is it possible to use % sign in post permalinks?
- Remove/hide a specify category-name from the url
- Page permalink ending in “-2”
- rewrites and custom links in page need help with add_rewrite_rule
- Change the permalinks structure
- Although rewrite engine is on, I get 404 not found on every page
- how to change permalinks from id to name of a particular location
- Using a taxonomy value as part of a post URL
- Why do I have “category” in my permalinks?
- Getting the Posts’ permalinks from XLMRPC
- WordPress: Permalinks link to old names
- Permalinks is not working in my wordpress setup
- Use .htaccess to redirect homepage to its permalink
- -2 generated in permalink postname [duplicate]
- Permalink stops working for the latest post only about 15 minutes after publishing/editing
- Yoast SEO canonical URL gets pointed to the homepage
- Removing /wp in Permalink URL of subdomain led to inaccessibility to WP Dashboard
- Duplicate Content Issue with WordPress Permalink Structure and Primary Categories