[Plugin: Project Status] Assigning project to a specific user.
-
Hi,
It’s a great little plugin, many thanks! One thing it lacks – imo substantial functionality – is the ability to assign a project to a specific (logged in) user of the site. It would allow easy integration with membership sites.
I’ve managed to do it by custom page template (update proof) but I think it would be beneficial to have this available as a switchable shortcode option. (something like [project id=auto])
Here’s a chunk of code I’ve used in page template for automatic project selection:
<?php wp_get_current_user(); ?> <?php $current_user_email = $current_user->user_email; $projects_query = new WP_Query( 'post_type=client_projects' ); while ( $projects_query->have_posts() ) : $projects_query->the_post(); $custom_project_data = get_post_custom($post->ID); $project_owner_email = $custom_project_data["pjsp_client_email"][0]; if ($project_owner_email == $current_user_email) { $current_project_shortcode = '[project id=' . $post->ID . ']'; } endwhile; ?> <?php wp_reset_postdata(); ?> <?php echo do_shortcode( $current_project_shortcode ) ?>
For this to work you need to uncomment line 123 in project-status.php and assign user e-mail address from specific user profile to Client E-mail field in Notifiy Client Tab on your project page.
Line 123: add_meta_box("project_update","Notify Client", "project_update","client_projects","normal","low");
Then it will select select project based on currently logged in user email address and e-mail address from Notify Client tab on a user page.
Hope you guys going to consider adding something like that to your plugin in a shortcode form.
Cheers
- The topic ‘[Plugin: Project Status] Assigning project to a specific user.’ is closed to new replies.