| @@ -12,9 +12,11 @@ | ||
| 12 | 12 | $categories = $wpdb->get_results($sql); |
| 13 | 13 | $wppm_current_user_capability = get_user_meta( $current_user->ID, 'wppm_capability', true ); |
| 14 | 14 | $wppm_rich_text_editor = get_option('wppm_rich_text_editor'); |
| 15 | 15 | $wppm_toolbar_actions = get_option('wppm_toolbar_actions'); |
| 16 | -if (!($current_user->ID && $current_user->has_cap('wppm_admin') || $current_user->has_cap('manage_options') || $current_user->ID && $current_user->has_cap('wppm_manager'))) { | |
| 16 | +$wppm_can_create_project = ( $current_user->ID && $current_user->has_cap('wppm_admin') ) || $current_user->has_cap('manage_options') || ( $current_user->ID && $current_user->has_cap('wppm_manager') ); | |
| 17 | +$wppm_can_create_project = apply_filters( 'wppm_can_create_project', $wppm_can_create_project, $current_user->ID ); | |
| 18 | +if (!$wppm_can_create_project) { | |
| 17 | 19 | exit; |
| 18 | 20 | } |
| 19 | 21 | ?> |
| 20 | 22 | <form class='wppm_add_new_project wppm_bootstrap' id="wppm_add_new_project" method="post"> |
| @@ -22,9 +24,9 @@ | ||
| 22 | 24 | <div class="col-sm-12"> |
| 23 | 25 | <span class="wppm-heading-inline" style="margin-left:15px;"> |
| 24 | 26 | <?php echo esc_html_e('Create Project','taskbuilder');?> |
| 25 | 27 | </span> |
| 26 | - <?php if($current_user->has_cap('manage_options') || $wppm_current_user_capability == 'wppm_manager'|| $wppm_current_user_capability == 'wppm_admin' ){ ?> | |
| 28 | + <?php if($wppm_can_create_project){ ?> | |
| 27 | 29 | <span class="wppm-add-new-btn btn-primary" id="wppm_add_new_proj" onclick="wppm_add_new_project()" ><span style="margin-right:5px;"></span><span><?php echo esc_html_e('+Create Project','taskbuilder');?></span></span> |
| 28 | 30 | <?php } ?> |
| 29 | 31 | <span class="wppm-add-new-btn btn-primary" id="wppm_project_list" onclick="wppm_get_project_list()" ><span style="margin-right:5px;"><img src="<?php echo esc_url( WPPM_PLUGIN_URL . 'asset/images/list-symbol.svg'); ?>" alt="list-symbol"></span><span><?php echo esc_html_e('Project List','taskbuilder');?></span></span> |
| 30 | 32 | </div> |