Pro, Editor, WP Hook, Save Page, Any News?

Any news to this @christian_y??

Hello @RSMG,

Thanks for asking. :slight_smile:

I am not in a position to share ETA at the moment, really sorry for that. Our developers are at work round the clock working on adding few features and fixing bugs. However, you can take a look at our status report post.

Thanks for understanding.

Hello Prasant,

I just wanted to know if any developer said something to why Pro does not use any standard wordpress hooks. Nothing about an ETA or something else.

Hi @RSMG,

There is no ETA yes and there is no available information as of yet. All caching plugins could cause issues to Pro and its builder, but some plugins has option to disable cache for logged in users which is why the Pro and its builder are working on them, one sample is the W3 Total Cache. Any cache plugin should option to exclude logged user or exclude certain files.

Remember that you’re introducing changes when you’re editing in the admin and the builder, and there is no use to cache the admin too since cache is against change.

Thanks!

Hi Rad,

thanks for your answer but this was not my question again. My question ist really simple: Why Pro does not use the standard Wordpress hook “save_post” if I press SAVE in the editor? @christian_y told me, that he will post this and I just wanted to know if there is any answer yet. Thats it.

But to your post: Of course has this caching plugin an option to disable cache for logged in users but this is not the point. If I do a change I want that my users see this changes instantly not in two weeks when the cache will be refreshed automatically. So this caching plugin will refresh the page if the wordpress hook “save_post” is called. Pro does not call “save_post” so I have to refresh the cache everytime manually.

Hi @RSMG,

Yes, I answered both, there is no ETA and there is no available information about why. I assume you’re expecting to see save_post within the builder’s code?

Though I may add something, the builder saves its content to the post meta ( hence no save_post https://codex.wordpress.org/Function_Reference/update_post_meta, and it’s Wordpress standard too ) and not to the post content, BUT it generates shortcodes upon save to the post content (hence, with save_post is called too https://codex.wordpress.org/Function_Reference/wp_update_post).

You can find at this file cornerstone\includes\classes\content\class-content.php of the builder that it uses wp_update_post. And if you’re going to check wp_update_post code here https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-includes/post.php#L0, it has this line

return wp_insert_post( $postarr, $wp_error );

And the code of wp_insert_post return line is this, do_action( 'save_post', $post_ID, $post, $update );. Hence, if we’ll trace the function call.

Cornerstone > wp_update_post > wp_insert_post > save_post

The cornerstone doesn’t need to directly use save_post hook since it’s already there. The ones that need to use that hook save_post are the one that needs to intercept the post data upon saving.

Then please check this https://codex.wordpress.org/Plugin_API/Action_Reference/save_post

save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. The data for the post is stored in $_POST, $_GET or the global $post_data, depending on how the post was edited. For example, quick edits use $_POST.

The hook is triggered whenever the data processing of the post or page is done. The save_post is not necessarily in the code of a plugin or theme. But again, I’m not sure why your cache plugin isn’t working and there is no enough information about that plugin. I also recommend in case you have contact to the plugin developer, that, don’t just rely on save_post hook, because it’s not just the content being changed, post meta and others too.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.