@@ -99,10 +99,11 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | echo '<h3>' . __( 'Custom Events', 'zt-debug-bar-cron' ) . '</h3>'; |
| 101 | 101 | |
| 102 | - if ( ! is_null( $this->_user_crons ) ) |
|
| 103 | - $this->display_events( $this->_user_crons ); |
|
| 104 | - else |
|
| 105 | - echo '<p>' . __( 'No Custom Events scheduled.', 'zt-debug-bar-cron' ) . '</p>'; |
|
| 102 | + if ( ! is_null( $this->_user_crons ) ) { |
|
| 103 | + $this->display_events( $this->_user_crons ); |
|
| 104 | + } else { |
|
| 105 | + echo '<p>' . __( 'No Custom Events scheduled.', 'zt-debug-bar-cron' ) . '</p>'; |
|
| 106 | + } |
|
| 106 | 107 | |
| 107 | 108 | echo '<h3>' . __( 'Schedules', 'zt-debug-bar-cron' ) . '</h3>'; |
| 108 | 109 | |
@@ -110,10 +111,11 @@ discard block |
||
| 110 | 111 | |
| 111 | 112 | echo '<h3>' . __( 'Core Events', 'zt-debug-bar-cron' ) . '</h3>'; |
| 112 | 113 | |
| 113 | - if ( ! is_null( $this->_core_crons ) ) |
|
| 114 | - $this->display_events( $this->_core_crons ); |
|
| 115 | - else |
|
| 116 | - echo '<p>' . __( 'No Core Events scheduled.', 'zt-debug-bar-cron' ) . '</p>'; |
|
| 114 | + if ( ! is_null( $this->_core_crons ) ) { |
|
| 115 | + $this->display_events( $this->_core_crons ); |
|
| 116 | + } else { |
|
| 117 | + echo '<p>' . __( 'No Core Events scheduled.', 'zt-debug-bar-cron' ) . '</p>'; |
|
| 118 | + } |
|
| 117 | 119 | |
| 118 | 120 | echo '</div>'; |
| 119 | 121 | } |
@@ -127,11 +129,13 @@ discard block |
||
| 127 | 129 | * @return array Array of crons. |
| 128 | 130 | */ |
| 129 | 131 | private function get_crons() { |
| 130 | - if ( ! is_null( $this->_crons ) ) |
|
| 131 | - return $this->_crons; |
|
| 132 | + if ( ! is_null( $this->_crons ) ) { |
|
| 133 | + return $this->_crons; |
|
| 134 | + } |
|
| 132 | 135 | |
| 133 | - if ( ! $crons = _get_cron_array() ) |
|
| 134 | - return $this->_crons; |
|
| 136 | + if ( ! $crons = _get_cron_array() ) { |
|
| 137 | + return $this->_crons; |
|
| 138 | + } |
|
| 135 | 139 | |
| 136 | 140 | $this->_crons = $crons; |
| 137 | 141 | |
@@ -154,10 +158,11 @@ discard block |
||
| 154 | 158 | foreach ( $time_cron_array as $hook => $data ) { |
| 155 | 159 | $this->_total_crons++; |
| 156 | 160 | |
| 157 | - if ( in_array( $hook, $core_cron_hooks ) ) |
|
| 158 | - $this->_core_crons[ $time ][ $hook ] = $data; |
|
| 159 | - else |
|
| 160 | - $this->_user_crons[ $time ][ $hook ] = $data; |
|
| 161 | + if ( in_array( $hook, $core_cron_hooks ) ) { |
|
| 162 | + $this->_core_crons[ $time ][ $hook ] = $data; |
|
| 163 | + } else { |
|
| 164 | + $this->_user_crons[ $time ][ $hook ] = $data; |
|
| 165 | + } |
|
| 161 | 166 | } |
| 162 | 167 | } |
| 163 | 168 | |
@@ -171,8 +176,9 @@ discard block |
||
| 171 | 176 | * @return void|string Void on failure; table display of events on success. |
| 172 | 177 | */ |
| 173 | 178 | private function display_events( $events ) { |
| 174 | - if ( is_null( $events ) || empty( $events ) ) |
|
| 175 | - return; |
|
| 179 | + if ( is_null( $events ) || empty( $events ) ) { |
|
| 180 | + return; |
|
| 181 | + } |
|
| 176 | 182 | |
| 177 | 183 | echo '<table class="zt-debug-bar-cron-event-table" cellspacing="0">'; |
| 178 | 184 | echo '<thead><tr>'; |
@@ -196,10 +202,11 @@ discard block |
||
| 196 | 202 | foreach ( $data as $hash => $info ) { |
| 197 | 203 | // Report the schedule |
| 198 | 204 | echo '<td>'; |
| 199 | - if ( $info['schedule'] ) |
|
| 200 | - echo wp_strip_all_tags( $info['schedule'] ); |
|
| 201 | - else |
|
| 202 | - echo 'Single Event'; |
|
| 205 | + if ( $info['schedule'] ) { |
|
| 206 | + echo wp_strip_all_tags( $info['schedule'] ); |
|
| 207 | + } else { |
|
| 208 | + echo 'Single Event'; |
|
| 209 | + } |
|
| 203 | 210 | echo '</td>'; |
| 204 | 211 | |
| 205 | 212 | // Report the interval |