@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function update( $data ) { |
|
31 | + public function update($data) { |
|
32 | 32 | |
33 | - $post_id = isset( $data['post_id'] ) ? $data['post_id'] : false; |
|
33 | + $post_id = isset($data['post_id']) ? $data['post_id'] : false; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $allowed_fields The fields |
42 | 42 | */ |
43 | - $allowed_fields = apply_filters( 'lasso_meta_fields', array() ); |
|
44 | - if ( ! empty( $allowed_fields ) ) { |
|
45 | - foreach( $allowed_fields as $field ) { |
|
46 | - if ( isset( $data[ $field ] ) ) { |
|
43 | + $allowed_fields = apply_filters('lasso_meta_fields', array()); |
|
44 | + if (!empty($allowed_fields)) { |
|
45 | + foreach ($allowed_fields as $field) { |
|
46 | + if (isset($data[$field])) { |
|
47 | 47 | //this original line changed dash to underscore |
48 | 48 | //update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ] ); |
49 | - update_post_meta( $post_id, $field, $data[ $field ] ); |
|
49 | + update_post_meta($post_id, $field, $data[$field]); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return array Array of keys to pull from $data per action and their sanitization callback |
66 | 66 | */ |
67 | - public static function params(){ |
|
68 | - $params[ 'process_meta_update' ] = array( |
|
67 | + public static function params() { |
|
68 | + $params['process_meta_update'] = array( |
|
69 | 69 | 'post_id' => 'absint', |
70 | 70 | 'tab_name' => 'trim' |
71 | 71 | ); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return array Array of additional functions to use to authorize action. |
83 | 83 | */ |
84 | 84 | public static function auth_callbacks() { |
85 | - $params[ 'process_meta_update' ] = array( |
|
85 | + $params['process_meta_update'] = array( |
|
86 | 86 | 'lasso_user_can' |
87 | 87 | ); |
88 | 88 |