Getting admin notices to appear after page refresh

You should use set_transient this is stored and will show up after the page reloads as it is like cookies on the server side. function SITE_profile_update_notice() { // Add this to your code where you want to the transient to fire after function set_transient( ‘fx-admin-notice-panel’, true, 5 ); } /* Add admin notice */ add_action( … Read more

Filter for when the post is updated

The filter you are looking for is save_post. This filter is triggered each time you save a post. add_action( ‘save_post’, ‘my_function’ ); function my_function( $post_id ){ // Do your stuff here } This filter passes the post’s ID to the callback function, so you have access to everything you need.

How to search variable product by its variation id in woocommerce admin product search box?

Finally I have implement the above functionality by modifying the filter “posts_search”. By using bellow code you can search variable products by their variations id in woocommerce admin product search area. add_filter( ‘posts_search’, ‘product_search’ ); function product_search( $where ) { global $pagenow, $wpdb, $wp; if ( ‘edit.php’ != $pagenow || ! is_search() || ! isset( … Read more

How to verify nonces in bulk?

You don’t need a nonce for every field, a single nonce should suffice This is because a nonce isn’t tied to a field, it’s tied to a request, and verifies that you did indeed intend to press update, or click a link, submit a form, etc As an example, back in the days of MySpace, … Read more

WordPress Password security related questions

When admin is resetting all users password are the users getting notified about the password reset? I read that with some “Emergency password reset” plugin it is available, but is it a built in feature in WordPress or no. WordPress doesn’t have an option to reset all users passwords, so it would depend on the … Read more

Move plugin-settings to ‘Settings’-menu in the admin

You seem to be making life complicated. Here’s the code you need; function menu_shuffle() { remove_menu_page( ‘plugin-page’ ); add_submenu_page(‘options-general.php’,’Page Title’, ‘Menu Label’,’manage_options’, ‘plugin-page’ ); }; add_action( ‘admin_menu’, ‘menu_shuffle’ ); plugin-page can be found by mousing over the existing menu label and getting the part after the ?page=in this case ?page=plugin-page The WordPress function definition for … Read more