Skipping all WP functions for a cached version
Skipping all WP functions for a cached version
Skipping all WP functions for a cached version
I found a workaround, in this forum – This did the trick: [https://wordpress.stackexchange.com/questions/225760/update-is-always-true-in-save-post][1] It’s still hit multiple times, but it’s working.
Hook to Use Second Field Before Fallback
I am not sure If I get what you meant, but study https://developer.wordpress.org/reference/hooks/render_block_this-name/ filter, whan calling it give it $accepted_args number of 3 and inspect what is returned in $block_content or $instance. ID is encoded as ref attribute, if that’s what you are missing. You could also use render_block filter, but render_block_{$this->name} is more convenient, … Read more
Unable to trigger a frontend @wordpress/hooks action
update ACF field when saving post on back office
The trouble is that they ‘enqueue_block_assets’ is not the right hook to use for conditional resources anyway. The correct hook to use for the backend is : add_editor_style( ‘path/to/my-core-style-overrides.css’), which should be inside ‘after_setup_theme’ hook. This will ensure that these styles are incorporated in the admin editor iframe only and in all places where that … Read more
You could for example save an error flag to a transient in save_post, if a required field is empty, and the display the admin notice based on the transient. This concept is demonstrated in in this old answer. Another option is to add a simple script to the editing view which would alert the user … Read more
The problematic line is the one for the transition_post_status action’s callback as the input parameter is post status (string) but not post ID (integer): https://developer.wordpress.org/reference/hooks/transition_post_status/
WordPress presents default category as a setting in Settings -> Writing (though this doesn’t seem to pre-check the checkbox): The new_to_auto-draft action will allow you to do things to a new post before the page loads, and does pre-check the checkbox (tested): add_action( ‘new_to_auto-draft’, static function ( $post ) { $default_category_id = 25; // The … Read more