Customize WP Filter Hook
Customize WP Filter Hook
Customize WP Filter Hook
You can achieve this by modifying your custom_login_redirect function to include a conditional check based on a parameter you pass from your specific page. Here’s an example of how you can modify your function: function custom_login_redirect($redirect_to, $request, $user) { // Check if there is a user and if the user has roles if (isset($user->roles) && … 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
Add “New” Sale badge to products in WooCommerce based on creation date
WordPress : how to create onglet and remove it when only one
I found a solution that worked (though I need to test it thoroughly) First, add a filter on the “page on front” option: function filter_page_on_front($default) { $current_post_language = detect_post_language(); if ($current_post_language) { $intro_page = get_current_page(); if ($intro_page) { $page_on_front = get_option(‘page_on_front_’ . $current_post_language, ”); if ($page_on_front && $intro_page->ID == $page_on_front) { return $page_on_front; } } … Read more
It turns out that it wasn’t really needed to find the default font as an empty string is interpreted as the default font. I just did it this way: <FontFamilyControl> value={ buttonFontFamily || ” } onChange={ ( newFontFamily ) => { setAttributes({ buttonFontFamily: newFontFamily }) } } </FontFamilyControl> Another important thing to notice here is … Read more