Why does before_delete_post run when opening a post in the backend?
Why does before_delete_post run when opening a post in the backend?
Why does before_delete_post run when opening a post in the backend?
How to filter the URL of thumbnail size in the Media Grid and admin pages
If I understand correctly, you want to do this: add_action(‘upgrader_process_complete’, ‘my_clear_elementor_cache’); function my_clear_elementor_cache() { // Make sure that Elementor loaded and the hook fired if (did_action(‘elementor/loaded’)) { // Automatically purge and regenerate the Elementor CSS cache \Elementor\Plugin::instance()->files_manager->clear_cache(); } }
I ended up using the updated_option hook and checking if a widget or sidebar has been updated. When a widget is added, removed or saved, the update_option hook is fired. All widget option names start with “widget_“. By checking if the option name starts with “widget_” we can determine if a widget was added, removed … Read more
I am trying to find a hook to be able to set a datalayer.push everytime a document is opened. It could even be something that runs after the document is opened ex: https://proximite-courtage.fr/wp-content/uploads/2022/06/LISTE_PARTENAIRES_PC_22062022.pdf No. WP isn’t running when you visit PDF files directly via their URL, so there is no PHP loaded and no opportunities … Read more
Not able to set userId and email at wp_set_current_user in Worpdress
How can I get the ID before after_setup_theme?
you can use the admin_enqueue_scripts hook to add support for the font sizes options to specific post types and page templates in the WordPress admin.
The answer is don’t use wp_set_post_terms, use wp_set_object_terms instead. wp_set_post_terms only works with the built-in post object.
I was able to prevent the unwanted altering of HTML by using the render_block_core/group filter, and a copy of wp_restore_group_inner_container, without the JSON support check. public static function my_add_block_group_inner( $block_content, $block ) { $tag_name = isset( $block[‘attrs’][‘tagName’] ) ? $block[‘attrs’][‘tagName’] : ‘div’; $group_with_inner_container_regex = sprintf( ‘/(^\s*<%1$s\b[^>]*wp-block-group(\s|”)[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|”)[^>]*>)((.|\S|\s)*)/U’, preg_quote( $tag_name, “https://wordpress.stackexchange.com/” ) ); $replace_regex = sprintf( ‘/(^\s*<%1$s\b[^>]*wp-block-group[^>]*>)(.*)(<\/%1$s>\s*$)/ms’, … Read more