function task_breaker_bp_projects_content() { echo '<div id="task_breaker-intranet-projects">'; $user_groups = task_breaker_get_displayed_user_groups(); $current_user_groups = task_breaker_get_current_user_groups(); $groups_collection = array(); if (!empty($user_groups)) { foreach ($user_groups as $key => $group) { $groups_collection[] = $group['group_id']; } } // If there are no groups found assign negative value // so that WP_Query will return empty result if (empty($groups_collection)) { $groups_collection = array(-1); } $args = array('meta_query' => array(array('key' => 'task_breaker_project_group_id', 'value' => $groups_collection, 'compare' => 'IN'))); task_breaker_project_loop($args); echo '</div>'; return; }
</span> </div> <div class="task_breaker-form-field"> <label for="task_breaker-project-assigned-group"> <?php _e('Assign to Group:', 'task_breaker'); ?> </label> <?php $current_user_groups = task_breaker_get_current_user_groups(); ?> <?php $current_project_group = intval(get_post_meta($post->ID, 'task_breaker_project_group_id', true)); ?> <?php if (!empty($current_user_groups)) { ?> <select name="task_breaker-project-assigned-group" id="task_breaker-project-assigned-group"> <?php foreach ($current_user_groups as $group) { ?>