From a plugin how can I show a message to a user? Specifically I'd like to show a message to any user after comment submission indicating that their comment was submitted. My thought was to hook into the comment_post action. However in searching for this I could not find an answer to the more general problem of how to show a message to a user. The message should be shown to the user a single time regardless of whether they …
Admin side I submit form to admin-post.php. I want to print success message in the bottom of the form. Iam new in wordpress what i did shown below. admin.php?page=add-products form code <form action="<?php echo admin_url('admin-post.php') ?>" method="post"> <table> <input type="hidden" name="action" value="add_product_from_admin"> <tr><td>Name</td><td><input type="text" name="pr_name" id="pr_name"></td></tr> <tr><td colspan="2" align="center"><input type="submit" name="pr_submit" id="pr_submit" value="Save Products"></td></tr> </table> </form> add_action( 'admin_post_add_product_from_admin', 'add_product_into_data_base' ); function add_product_into_data_base() { //some database operations wp_redirect(admin_url('admin.php?page=add-products&message=success')); }
I think wordpress used to automatically redirect to a page with a message telling a newly registered user to check their email box to activate their account. For some reason, when a new person registers now, they are automatically redirected to the home page with no alert or message. I've been trying to get wordpress to display an alert to the user after clicking "Sign Up" with: add_action('user_register','check_your_email'); function check_your_email(){ echo "<script> alert('There are no fields to generate a report'); …
I want to create custom message when site got any error or broken or it is also be helpful if I can redirect site url to my custom page when site got error for example "www.demo.com" to "www.demo.com/custom-error-message-page" where I can display my message to visitors and also want those error to notify in my email. I have tried wp_debug in wp-config to set to true but it shows all error on all pages of site instead that I only …
I want to customize notification for post author when comment is posted. My code in functions.php is : //add notifications when comment add_action( 'wp_insert_comment', 'wp_notify_postauthor' ); //change email notification comment function wpd_comment_notification_text( $notify_message, $comment_id ){ // get the current comment and post data $comment = get_comment( $comment_id ); $post = get_post( $comment->comment_post_ID ); // don't modify trackbacks or pingbacks if( '' == $comment->comment_type ){ // build the new message text $notify_message = sprintf( __( 'New comment on your post "%s"' …
I want to disable the email notification if a user or an admin changes the password of a user. After some Googling I came to find that I need to create a plugin and overwrite the wp_password_change_notification function found in pluggable.php. This is the plugin and function: <?php /* Plugin Name: Stop email change password Description: Whatever */ if ( !function_exists( 'wp_password_change_notification' ) ) { function wp_password_change_notification() {} } ?> I uploaded the file to my plugin folder and activated …
I'm working on a plugin with a custom post type called "important_dates" I want to delete the Wordpress admin notification when a new custom post is created. Here is my code - it deletes the notifications for all post types. How do I make it work for only my "important_dates" custom post type? add_filter( 'post_updated_messages', 'post_published' ); function post_published( $messages ) { unset($messages['posts'][6]); return $messages; } }
Using the automatic update of my self-hosted WordPress blogs, I configured automatic updates of both the WordPress core as well as WordPress plugins and themes (through this plugin). Whenever a core update occurs, I get an email like: Your site has updated to WordPress 3.9.2 Howdy! Your site at http://example.org has been updated automatically to WordPress 3.9.2. No further action is needed on your part. For more on version 3.9.2, see the About WordPress screen: http://example.org/wp-admin/about.php If you experience any …
I'm trying to use icons to communicate messages between an Admin and the site's Registered Users (both collectively and individually): An Admin to posts a message in some type of back-end interface (Custom Post Type, maybe?) The Admin can designate the individual user(s) or all users (for a site-wide messages) The user(s) see the all the message since the user last logged in via a well recognizable "bell" icon with numbers indicating the number of new messages. See my example …
I create an ajax form and I well received the email. Now, I just want to do like CF7, send an automatic response to the sender to notify him that I well received the form. Which function used or which hook ? Apart from Reply_to with Headers of wp_mail I didn't find any solution to send confirmation or notification. Anybody can fill the form. Here php code to send the form : function mail_form(){ if ( ! wp_verify_nonce( $_POST['nonce'], 'ajax-nonce' …
When WordPress is installed, it sends a notification New WordPress Site Your new WordPress site has been successfully set up at: ... I would like to change the text of the e-mail but am not successfull. Here is what I tried: I added the following code to the main file of a plugin which I add before the installation function changed_install_mail($installed_email, $user, $blog_title, $blog_url, $password ) { $installed_email['subject'] = 'test'; return $installed_email; } add_filter( 'wp_installed_email', 'changed_install_mail', 10, 5 ); I …
I am new to integrating Wordpress and Mailchimp. I have a Wordpress site that offers music courses. Within a course are several lessons. I drip the lessons weekly, so that each lesson starts on a Monday. I just added Mailchimp support via my site's composer.json by adding "require": { "mailchimp/marketing": "*" } I can now use the Mailchimp API via require_once ABSPATH.'/vendor/autoload.php'; use MailchimpMarketing\ApiClient as MailChimp; $mailchimp = new Mailchimp(); $mailchimp->setConfig([ 'apiKey' => MAILCHIMP_APIKEY, 'server' => MAILCHIMP_SERVER_PREFIX ]); So all …
I have a cpt called "auto" and i make a frontend form to create new post with "pending" status. After the post submission i would receive an email with a notification of the new post. function newpost_notify() { $mailadmin = '[email protected]'; $subject = 'Subject'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; $headers .= 'From: xxx <[email protected]>' . "\r\n"; $message = 'There\'s a new post.'; wp_mail( $mailadmin, $subject, $message, $headers ); } add_action( 'publish_post', 'newpost_notify', …
Some old posts were accidentally removed from my self hosted site. I started replacing them from back-ups, but the people who subscribe to my WordPress Feed (and email notification) complained they were being spammed with old posts. Is there a way to turn off both the RSS feed and the email notification the next time I restore missing posts? This needs to be temporary. There are disable RSS plug-ins, but they seem to be about killing RSS altogether rather than …
I'm using the code below that I found in another thread. When a user makes changes to their profile, this snippet sends an email notification that something has been changed. I'd like to amend this so that we can be notified which fields specifically (Name, email, phone, etc) have been changed. Is there a simple way to achieve this by amending this code? I'm pretty new to php and coding i general so please explain like I'm dumb. Thank you …
I'm looking to add some custom functionality to the admin side and I want to change the way the admin notifications work. Where are the admin notifications stored? And when a user dismisses one, where is that being recorded?
I'm in the process of loading up a WordPress site with content. When a user subscribes to the site, instead of getting only new blog posts, I'd like that user to be "dripped" all blog posts from the beginning, one per day. Is that possible via a plug-in or a third-party "drip" provider, or does something need to be built?
WordPress.com has a rather cool feature when you add comments. The two features are: [x] Notify me of follow-up comments via email. [x] Notify me of new posts via email. Is this plugin available somewhere so that I can include it on my privately hosted blog?