Tag Info

Hot answers tagged

12

For example if you don't want Wordpress to show update notifications for akismet, you will do it like: function filter_plugin_updates( $value ) { unset( $value->response['akismet/akismet.php'] ); return $value; } add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );


10

There's a few plugins that handle email notifications, but they all seem to act like a subscription service for (all) WordPress users. To notify just you when a post or page is published, it's literally a few lines of code. function __notify_admin_on_publish( $new_status, $old_status, $post ) { if ( $new_status != 'publish' || $old_status == 'publish' ...


6

Don't ask me way but i actually have a function to count hooked functions to a tag /** * count_hooked_functions * @author Ohad Raz * @param string $tag hook name as string * @return int the number of hooked functions to a specific hook */ function count_hooked_functions($tag = false){ global $wp_filter; if ($tag){ if ...


5

You can change them using a filter. The filter hooks you want to use are: For the first email message (confirming they really want to reset the password): 'retrieve_password_title' 'retrieve_password_message' For the follow-up email message (sending the new username and password): 'password_reset_title' 'password_reset_message' ...


4

I would do this when you call add_options_page(), not later. It's always better to do this with the supported API instead of playing with the internal structures. The plugin updater periodically checks the plugin status and then saves the result in a transient. This means that it only reads this cached status when the menu is created, it doesn't do the full ...


4

In addition to having the same name, I think it checks the folder name first for updates. You should also change your folder name if you are planning to distribute publicly, or if this is private, you can exclude it from update checks: http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/. It would still probably be ...


4

You can try something like this in your functions.php function send_comment_email_notification( $comment_ID, $commentdata ) { $comment = get_comment( $comment_id ); $postid = $comment->comment_post_ID; $master_email = get_post_meta( $postid, 'master_email', true); if( isset( $master_email ) && is_email( $master_email ) ) { ...


4

First: Don’t use mail(). Use wp_mail() instead. wp_mail( // Send it to yourself get_option( 'admin_email' ), 'Your subject', 'Your message', // extra headers array ( 'Bcc:' . implode( ",", $usersarray ), 'From:' . get_option( 'admin_email' ) ) );


3

this works fine for a specific user login: global $user_login; get_currentuserinfo(); if ($user_login !== "admin") { // change admin to the username that gets the updates add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ...


3

I'd say there's three specific requirements here; Allow users to choose notification times, timezone aware Hook into transition_post_status to listen up for new posts, and then take action Find a decent SMS API For 1), hook into show_user_profile to output your time picker field(s), and personal_options_update to save them. You could detect the user's ...


2

You could try this inside your themes functions.php: its a function by dagon design function dddn_process($id) { global $wpdb; $tp = $wpdb->prefix; $result = $wpdb->get_row(" SELECT post_status, post_title, user_login, user_nicename, display_name FROM {$tp}posts, {$tp}users WHERE {$tp}posts.post_author = {$tp}users.ID AND ...


2

As far as display goes, the admin code does this in several ways. Via the 'message' class for stuff that shows once at the top of the content area. On the left nav menu, either on the Plugins tab or up where it says Dashboard. And in the list of themes (or plugins). Items 2 and 3 get their information via a handshake with the api.wordpress.org server. ...


2

I don't see this as excessively heavy. Just use is_user_logged_in() and current_user_can(). Obviously if user isn't logged in then you can skip checking for any roles. I am not sure, but user data is probably held in memory so there will be no extra database calls and such.


2

http://wordpress.org/extend/plugins/gurken-subscribe-to-comments/ http://wordpress.org/extend/plugins/subscribe2/


2

There are often issues with setting up email subscriptions. Hosting providers are very tired of spam and often put harsh restrictions on email rate and volume, especially for cheaper hosting plans. In practice such feature is often implemented with help of external service. FeedBurner is popular for this, because a lot of people use it for feeds anyway and ...


2

For Facebook: http://wordpress.org/extend/plugins/simple-facebook-connect/ For Twitter: http://wordpress.org/extend/plugins/simple-twitter-connect/ For Google+ http://wordpress.org/extend/plugins/simple-google-connect/ The twitter and facebook plugins will autopost from your site to each service. The G+ plugin is new, and still under development. I don't ...


2

This is a one time work for every blog you maintain. Go to Dashboard >Settings >Discussion and see following: E-mail me whenever: Anyone posts a commentA comment is held for moderationSomeone likes one of my postsSomeone follows my blog Unmark the option at which you don't want to recieve any email notifications. All done!


2

It's quite simple, just hook a function on comment_post in which you check if the comment is a reply and send the author of the parent comment an email: add_action('comment_post', 'notify_author_of_reply', 10, 2); function notify_author_of_reply($comment_id, $approved){ if($approved){ $comment = get_comment($comment_id); ...


2

Try this. I cleaned up your arg array and placed everything in a function. Also, why are you using the getInstance method when your efpd_admin_notice is public? See the code below for accessing this method properly. function plugin_update(){ $plugin_update = Efpdd::efpd_admin_notice(array( 'type' => 'update', 'message' => 'The ...


2

@user2647 seems to be on the right path, but I think that this is more correct: remove_action( 'wpmu_new_user', 'newuser_notify_siteadmin' ); add_action( 'wpmu_new_user', 'my_notification' ); function my_notification ($user_id) { // Make your custom notification here. }


2

I was able to override the multi-site notification email by adding these: remove_filter('wpmu_signup_user_notification_email','admin_created_user_email'); add_filter('wpmu_signup_user_notification_email',<function_name_here>); add_filter('wpmu_signup_user_notification',<function_name_here>); ...


2

If you're willing to use an outside provider, you can add the tag feed to Feedburner. First get the tag feed: http://www.example.com/?tag=tagname&amp;feed=rss2 Then to to feedburner.com and create a feed, then enable "Email Subscriptions" (under the "Publicize" tab). I've done this, and it works well.


2

I haven't used it yet, but you can accomplish this with Jetpack, which is made (at least partially) by the founders of Wordpress. The advantage is that it uses the Wordpress.com servers to handle the outgoing mail. This is a big plus because shared servers have throttling limits that only allow you to send a certain amount of e-mails in a given time frame ...


2

$post_id is an integer (just the post id) and not a post object (the whole post with id,status,title ...) so globalize the $post object and check the status from there eg: function er_send_email_on_post_draft_save( $post_id ) { global $post; //verify post is not a revision if ( $post->post_status == 'draft' ) { $post_title = ...


2

Here's an idea: use the save_post hook to set a session containing the message you want to show the user and then redirect to the home page. In the home page template, check for the presence of that session and show the message to the user. Something like this: functions.php: add_action( 'save_post', 'wpse60249_save_post' ); function wpse60249_save_post( ...


2

In the WordPress backend at Settings->Reading there is a setting near the middle labeled "Email me Whenever". Uncheck those two boxes. I believe that will prevent the system from sending those email, leaving only the emails that you send.


2

The function that sends emails to the post author is called wp_notify_postauthor() and is located in /wp-includes/pluggable.php. This means that the function is "pluggable" and can be overridden by another function with the same name. We can make a simple plugin to do this. This is the code we'll be adding to the function to check if the author is posting ...


2

http://codex.wordpress.org/Plugin_API/Action_Reference/user_register This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument. add_action('user_register', 'registration_redirect'); function registration_redirect($user_id) { $url = ...


2

The wp_notify_postauthor() function is pluggable meaning that you can copy the code and paste it into a plugin file or theme functions file keeping the same function name and WordPress will use your version rather than its own. Edit your version of the function to send as much or as little information as you like.


2

You'll need to check the $pagenow variable and the post type of the post being edited. It will look something like this: function wpse_75224_admin_notices() { global $pagenow; $is_edit_custom_post_type = ( 'post.php ' == $pagenow && 'my_custom_post_type' == get_post_type( $_GET['post'] ) ); $is_new_custom_post_type = ( 'post-new.php' == ...



Only top voted, non community-wiki answers of a minimum length are eligible