How do I enqueue a script to run inside the Gutenberg editor?

I’m using the Gutenberg editor as a replacement for a whiteboard in a classroom. I’m able to make the classroom more interactive by having students work directly inside the Gutenberg editor. What a cool use of WordPress you describe there! Is it possible to load this script inside the Gutenberg editor, so that while my … Read more

remove_action in a theme

Your remove_action has to have a priority matching the priority used in add_action. Important: To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure. http://codex.wordpress.org/Function_Reference/remove_action In you case, it looks like remove_action(‘wp_head’, ‘theme_metas’); should … Read more

When is admin_init Action ran?

From the Codex: admin_init is triggered before any other hook when a user access the admin area. This hook doesn’t provide any parameters, so it can only be used to callback a specified function. So yes, it’s run on every admin page load.

Does the event ‘wp_version_check’ even exist? What is it doing?

The function checks your version of WP for possible updates. It appears that there is a transient in the database named ‘update_core’, so it’s stored in the $wpdb->options table as ‘_site_transient_update_core’. The value of that transient is a serialized object that has information, I’m not an expert on wp_version_check, but it uses that transient to … Read more

Why is there both a save_post and wp_insert_post action?

wp_insert_post was introduced in changeset 2887, and was to fix bug #1681. I couldn’t find the save_post hook’s original provenance, but it was most recently added to core in changeset 3291, related to ticket #2063. Evidently it had existed in 1.5.2 (although version control does not support this theory) and needed to be added back … Read more