Sending comment notifications to different recipients depending on taxonomy terms

Finally I found the right code, if it can be usefull to someone: function sp_comment_moderation_recipients( $emails, $comment_id ) { $comment = get_comment( $comment_id ); $post = get_post( $comment->comment_post_ID ); if ( has_term(‘myterm’,’mytaxonomy’, $post->ID) ) { return array( ‘[email protected]’ ); } return $emails; } add_filter( ‘comment_moderation_recipients’, ‘sp_comment_moderation_recipients’, 10, 2 ); add_filter( ‘comment_notification_recipients’, ‘sp_comment_moderation_recipients’, 10, 2 );

Adding Notification Bubble on Admin Top Bar

I will get you some idea on how to do this as you didn’t mention from where count data will come. Add following code to your theme/child-theme functions.php file function custom_admin_bar_menu() { $pending_count = wc_orders_count(‘pending’); $on_hold_count = wc_orders_count(‘on-hold’); $processing_count = wc_orders_count(‘processing’); if ( current_user_can( ‘manage_options’ ) ) { global $wp_admin_bar; //Add an icon with count … Read more

Can I show a custom message to a specific user?

Yes, if you will be doing that with code. You will have to – add a Role (like free user). Add this code (change code as needed for your work). function update_roles_free_user() { add_role( ‘free_user’, ‘Free User’, array( ‘read’ => true, ‘level_0’ => true ) ); } add_action( ‘init’, ‘update_roles_free_user’ ); You can use the … Read more

Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]

To check product has TAG or not you have to fetch product from order and search in them. //Custom NEW ORDER Email address depending on Product Tag add_filter( ‘woocommerce_email_recipient_new_order’, ‘new_order_conditional_email_recipient’, 10, 2 ); function new_order_conditional_email_recipient( $recipient, $order ) { if ( ! is_a( $order, ‘WC_Order’ ) ) return $recipient; // (Optional) // Get the order … Read more

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

Disable New User Registration Email sent to WordPress admin email on 4.9.5

the function wp_new_user_notification is one of the Pluggable Functions. In the documention you can read: Pluggable functions were introduced in WordPress 1.5.1 These functions let you override certain core functions via plugins. The most up-to-date list of core functions that WordPress allows plugins to override is available at wp-includes/pluggable.php. WordPress loads the built-in functions only … Read more

Save value from Javascript object to WP user

First off your setup is quite hard to understand. It seems that the only reason that you are exchanging data from client to server/ JS to PHP is that you have some global info JS object and some gonative_onesignal_info() method. Maybe it’s possible to find some PHP SDK or just retrieve that information either synchronously … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)