@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @since 1.0.0 |
| 93 | 93 | */ |
| 94 | 94 | private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
| 95 | - $hooks[] = array( |
|
| 95 | + $hooks[ ] = array( |
|
| 96 | 96 | 'hook' => $hook, |
| 97 | 97 | 'component' => $component, |
| 98 | 98 | 'callback' => $callback, |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function run() { |
| 112 | 112 | foreach ( $this->filters as $hook ) { |
| 113 | - add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 113 | + add_filter( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] ); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | foreach ( $this->actions as $hook ) { |
| 117 | - add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 117 | + add_action( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] ); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function setting_section_html( $args ) { |
| 159 | 159 | ?> |
| 160 | - <p id="<?php echo esc_attr( $args['id'] ); ?>"><?php esc_html_e( 'WP Site Monitor settings text', 'wp-site-monitor' ); ?></p> |
|
| 160 | + <p id="<?php echo esc_attr( $args[ 'id' ] ); ?>"><?php esc_html_e( 'WP Site Monitor settings text', 'wp-site-monitor' ); ?></p> |
|
| 161 | 161 | <?php |
| 162 | 162 | } |
| 163 | 163 | |
@@ -171,14 +171,14 @@ discard block |
||
| 171 | 171 | public function setting_input_html( $args ) { |
| 172 | 172 | $options = get_option( 'wp_site_monitor' ); |
| 173 | 173 | ?> |
| 174 | - <select id="<?php echo esc_attr( $args['label_for'] ); ?>" |
|
| 175 | - data-custom="<?php echo esc_attr( $args['wporg_custom_data'] ); ?>" |
|
| 176 | - name="wporg_options[<?php echo esc_attr( $args['label_for'] ); ?>]" |
|
| 174 | + <select id="<?php echo esc_attr( $args[ 'label_for' ] ); ?>" |
|
| 175 | + data-custom="<?php echo esc_attr( $args[ 'wporg_custom_data' ] ); ?>" |
|
| 176 | + name="wporg_options[<?php echo esc_attr( $args[ 'label_for' ] ); ?>]" |
|
| 177 | 177 | > |
| 178 | - <option value="red" <?php echo isset( $options[ $args['label_for'] ] ) ? ( selected( $options[ $args['label_for'] ], 'red', false ) ) : ( '' ); ?>> |
|
| 178 | + <option value="red" <?php echo isset( $options[ $args[ 'label_for' ] ] ) ? ( selected( $options[ $args[ 'label_for' ] ], 'red', false ) ) : ( '' ); ?>> |
|
| 179 | 179 | <?php esc_html_e( 'red pill', 'wporg' ); ?> |
| 180 | 180 | </option> |
| 181 | - <option value="blue" <?php echo isset( $options[ $args['label_for'] ] ) ? ( selected( $options[ $args['label_for'] ], 'blue', false ) ) : ( '' ); ?>> |
|
| 181 | + <option value="blue" <?php echo isset( $options[ $args[ 'label_for' ] ] ) ? ( selected( $options[ $args[ 'label_for' ] ], 'blue', false ) ) : ( '' ); ?>> |
|
| 182 | 182 | <?php esc_html_e( 'blue pill', 'wporg' ); ?> |
| 183 | 183 | </option> |
| 184 | 184 | </select> |