update_fax
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
1 changed file
with
50 additions
and
0 deletions
| ... | @@ -218,3 +218,53 @@ function format_phone_string( $phoneNumber ) { | ... | @@ -218,3 +218,53 @@ function format_phone_string( $phoneNumber ) { |
| 218 | 218 | ||
| 219 | return $phoneNumber; | 219 | return $phoneNumber; |
| 220 | } | 220 | } |
| 221 | |||
| 222 | |||
| 223 | function wpa_91930() { | ||
| 224 | // if query var is not present just return | ||
| 225 | if ( ! isset( $_REQUEST['my_listener'] ) || 'update_fax' != $_REQUEST['my_listener'] ){ | ||
| 226 | return; | ||
| 227 | }else{ | ||
| 228 | echo "Started<br>"; | ||
| 229 | $users = get_users( array( 'fields' => array( 'ID' ) ) ); | ||
| 230 | foreach($users as $user){ | ||
| 231 | $department_branch = get_user_meta( $user->ID, 'department_branch', true ); | ||
| 232 | switch($department_branch){ | ||
| 233 | case "Cranbrook Branch": | ||
| 234 | update_user_meta( $user->ID, 'phone_number_12', '250 426 7370' ); | ||
| 235 | break; | ||
| 236 | case "Commercial Department": | ||
| 237 | update_user_meta( $user->ID, 'phone_number_12', '250 426 0879' ); | ||
| 238 | break; | ||
| 239 | case "Elkford Branch": | ||
| 240 | update_user_meta( $user->ID, 'phone_number_12', '250 865 7537' ); | ||
| 241 | break; | ||
| 242 | case "Sparwood Branch": | ||
| 243 | update_user_meta( $user->ID, 'phone_number_12', '250 425 0047' ); | ||
| 244 | break; | ||
| 245 | case "Fernie Branch": | ||
| 246 | update_user_meta( $user->ID, 'phone_number_12', '250 423 9223' ); | ||
| 247 | break; | ||
| 248 | case "Castlegar Branch": | ||
| 249 | update_user_meta( $user->ID, 'phone_number_12', '250 365 2913' ); | ||
| 250 | break; | ||
| 251 | case "Slocan Valley Branch": | ||
| 252 | update_user_meta( $user->ID, 'phone_number_12', '250 226 7351' ); | ||
| 253 | break; | ||
| 254 | case "Greenwood Branch": | ||
| 255 | update_user_meta( $user->ID, 'phone_number_12', '250 445 9902' ); | ||
| 256 | break; | ||
| 257 | default: | ||
| 258 | echo "No department_branch set.<br>"; | ||
| 259 | break; | ||
| 260 | } | ||
| 261 | |||
| 262 | } | ||
| 263 | echo "Completed<br>"; | ||
| 264 | exit; | ||
| 265 | } | ||
| 266 | |||
| 267 | } | ||
| 268 | |||
| 269 | add_action( 'init', 'wpa_91930' ); | ||
| 270 | ... | ... |
-
Please register or sign in to post a comment