Is it possible to change an existing post status from ‘pending’ to ‘publish’ via email?

Step 1 – Register a Custom Query Var By adding a custom query var, you make WP aware of it so it can be used in requests. function wpse_add_query_vars( $vars ) { $vars[] = ‘wpse_set_to_publish’; return $vars; } add_filter( ‘query_vars’, ‘wpse_add_query_vars’ ); Step 2 – Sniff The Request Now we hook into parse_request to look … Read more

Ajax Check Post Status

So basicly you want an ajax method that checks for post changes. Here’s a great article on WP ajax for front & back-end. In short you want to do the following: Load the Ajax JS script on the pages you want to show the notification popup. Create wp ajax server-side handling, with hook wp_ajax_{your_custom_action}. OR … Read more

Is there a hook that is called only once after plugin bulk update process is completed?

I think the action you’re looking for is indeed upgrader_process_complete The Codex page doesn’t say specifically, so I’m not totally certain if it runs for each plugin or after all of them, but it works for me 🙂 function bgmc_plugins_update_completed( $upgrader_object, $options ) { // If an update has taken place and the updated type … Read more

Mechanism to send to users of secured WordPress install new notifications by SMS or email?

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 timezone … Read more

Send email only upon draft

$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 = get_the_title( $post_id … Read more

Displaying a message upon user registration

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=”PAGE_WHERE_YOUR_CODE_IS_DISPLAYED”; wp_redirect( $url ); exit; } placing that in your functions.php should work. This attempts to redirect the user … Read more

Menu Item Location

The wp_nav_menu_items filter has a secondary parameter that it passes: $args. What we need to do is set up our filter to accept second args by passing a priority 10 and the number of args 2: add_filter( ‘wp_nav_menu_items’, ‘my_counter_nav_menu’, 10, 2 ); Now that we’re passing args – if we peek into what it holds … Read more

Where are the admin notifications stored?

Where are the admin notifications stored? They aren’t. Admin notices have no storage unless you implement it yourself for your plugin/theme. WordPress provides hooks and styling for displaying admin notices, but that’s it. It might provide styling for dismissible admin notices but it provides no storage or registration mechanisms for persistence. And when a user … Read more

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