Multiple Checkbox

As mentioned, you’re doing several things wrong, namely mismatching field names & undefined variables: function checkbox(){ global $post; if ( ! is_array( $user_ids = get_post_meta( $post->ID, ‘user_ids’, true ) ) ) $user_ids = array(); $users = get_users(); foreach ( $users as $user ) { ?> <input id=”user_field_<?php echo $user->ID ?>” type=”checkbox” name=”user_ids[]” value=”<?php echo $user->ID … Read more

Different email notifications (about pending posts) to different users

add_action(‘future_to_pending’, ‘send_emails_on_new_event’); add_action(‘new_to_pending’, ‘send_emails_on_new_event’); add_action(‘draft_to_pending’, ‘send_emails_on_new_event’); add_action(‘auto-draft_to_pending’, ‘send_emails_on_new_event’); /** * Send emails on event publication * * @param WP_Post $post */ function send_emails_on_new_event($post) { $emails = “[email protected], [email protected]”; //If you want to send to site administrator, use $emails = get_option(‘admin_email’); $title = wp_strip_all_tags(get_the_title($post->ID)); $url = get_permalink($post->ID); $message = “Link to post: \n{$url}”; wp_mail($emails, “New post … Read more

Admin Logged In Notify Globaly

I think you should add an entry in database when admin log in and can remove or update that entry when user logout. there might be a situation when admin leave website without logged out for that you can set time for auto logout. I don’t think there is a way to find out if … Read more

WP Super Large Menu Problem

From first view this seems to be tough job, but actually even I having small skills of php could solve this problem just adding following code to my custom walker class: if ( $depth == 1 ) { // remove this statement if depth check is not required if (wp_get_nav_menu_object($item->title)) {// checking if item name … Read more

Cannot reset a loop in a plugin template

Your question is incomplete and you have omitted all the context for some weird reason. I hope we agree that query_posts() is a bad idea. There’s enough been said on it: When to use WP_query(), query_posts() and pre_get_posts Having said that, have you tried wp_reset_postdata, wp_reset_query or rewind_posts? I have no idea what you are … Read more

Manually updating plugins via FTP or SCM

You can just swap them out. Make sure you delete the old plugin files first though, in case the new version of the plugin doesn’t have that file anymore. The downside to doing it this way instead of using the gui is that if someone was to come to the site during the update there … Read more