6f024609 by Jeremy Groot

fix to broker sidebar

1 parent 9ad8e1b1
...@@ -145,8 +145,6 @@ if ( class_exists( 'WP_CLI' ) ) { ...@@ -145,8 +145,6 @@ if ( class_exists( 'WP_CLI' ) ) {
145 145
146 // } 146 // }
147 147
148 // syncBrokerListToPosts();
149
150 } 148 }
151 149
152 function rebuild_brokers_assigment($args ) { 150 function rebuild_brokers_assigment($args ) {
...@@ -249,6 +247,8 @@ if ( class_exists( 'WP_CLI' ) ) { ...@@ -249,6 +247,8 @@ if ( class_exists( 'WP_CLI' ) ) {
249 247
250 update_option('broker_list', serialize($new_brokers)); 248 update_option('broker_list', serialize($new_brokers));
251 249
250 syncBrokerListToPosts();
251
252 252
253 } 253 }
254 254
......
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
2 2
3 3
4 $individual_assignments = get_field('assignments', 'option'); 4 $individual_assignments = get_field('assignments', 'option');
5 $user_broker_id = get_user_meta(7525, 'broker_id', true); 5 $user_broker_id = get_user_meta(get_current_user_id(), 'broker_id', true);
6 6 // var_dump($user_broker_id);exit;
7 $farm_team_1 = get_field('farm_team_1', 'option'); 7 $farm_team_1 = get_field('farm_1', 'option');
8 $farm_team_2 = get_field('farm_team_2', 'option'); 8 $farm_team_2 = get_field('farm_2', 'option');
9 $commercial_team_1 = get_field('commercial_team_1', 'option'); 9 $commercial_team_1 = get_field('comm_1', 'option');
10 $commercial_team_2 = get_field('commercial_team_2', 'option'); 10 $commercial_team_2 = get_field('comm_2', 'option');
11 $commercial_team_3 = get_field('commercial_team_3', 'option'); 11 $commercial_team_3 = get_field('comme_3', 'option');
12 // var_dump($commercial_team_2);exit;
12 13
13 $assignment_arr = [['indep'=>[],'personal'=>[],'farm'=>[],'commercial'=>[]]]; 14 $assignment_arr = [['indep'=>[],'personal'=>[],'farm'=>[],'commercial'=>[]]];
14 15
...@@ -197,6 +198,7 @@ ...@@ -197,6 +198,7 @@
197 $cat = $staff_contact['category']; 198 $cat = $staff_contact['category'];
198 $sub_cat = $staff_contact['sub_category']; 199 $sub_cat = $staff_contact['sub_category'];
199 200
201
200 //Before check for if this is a direct broker assignment and it matches the current user 202 //Before check for if this is a direct broker assignment and it matches the current user
201 if($brokerages) { 203 if($brokerages) {
202 if(!hasBrokerAssignment($user_broker_id, $brokerages)) { 204 if(!hasBrokerAssignment($user_broker_id, $brokerages)) {
......