Completed
Push — beta ( 999e51...d374fe )
by
unknown
06:22 queued 11s
created
src/Core.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
     public function add_metabox()
56 56
     {
57 57
         $cl = $this;
58
-        if (! $this->timeshiftVisible()) {
58
+        if ( ! $this->timeshiftVisible()) {
59 59
             return;
60 60
         }
61
-        if (! isset($_GET['post']) || ! $this->hasTimeshifts($_GET['post'])) {
61
+        if ( ! isset($_GET['post']) || ! $this->hasTimeshifts($_GET['post'])) {
62 62
             return;
63 63
         }
64
-        add_action('add_meta_boxes', function () use ($cl) {
64
+        add_action('add_meta_boxes', function() use ($cl) {
65 65
             add_meta_box('krn-timeshift', __('Timeshift', 'kmm-timeshift'), [$cl, 'timeshift_metabox'], null, 'normal', 'core');
66 66
         });
67 67
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function timeshift_metabox()
70 70
     {
71 71
         global $post;
72
-        if (! isset($_GET['post'])) {
72
+        if ( ! isset($_GET['post'])) {
73 73
             return;
74 74
         }
75 75
         $prod_post = get_post($_GET['post']);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             if (isset($_GET['timeshift']) && $_GET['timeshift'] == $rev->id) {
107 107
                 $style = 'style="font-style:italic;background-color: lightblue;"';
108 108
             }
109
-            if(!isset($timeshift->meta['_edit_last']) || is_null($timeshift->meta['_edit_last'])) {
109
+            if ( ! isset($timeshift->meta['_edit_last']) || is_null($timeshift->meta['_edit_last'])) {
110 110
                 $timeshift->meta['_edit_last'] = 0; // some images dont have _edit_last field
111 111
             }
112 112
             echo '<tr ' . $style . '>';
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 
143 143
     public function inject_metadata_timeshift($value, $post_id, $key, $single)
144 144
     {
145
-        if (! isset($_GET['timeshift'])) {
145
+        if ( ! isset($_GET['timeshift'])) {
146 146
             return;
147 147
         }
148 148
         //Load timeshift
149
-        if (! $this->timeshift_cached_meta) {
149
+        if ( ! $this->timeshift_cached_meta) {
150 150
             $post_type = get_post_type($post_id);
151 151
             $table_name = $this->wpdb->prefix . 'timeshift_' . $post_type;
152 152
             $sql = "select * from $table_name where id=" . intval($_GET['timeshift']);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     public function inject_timeshift($p)
169 169
     {
170 170
         global $post;
171
-        if (! isset($_GET['timeshift'])) {
171
+        if ( ! isset($_GET['timeshift'])) {
172 172
             return;
173 173
         }
174 174
         //Load timeshift
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     {
186 186
         add_action('edit_form_top', [$this, 'inject_timeshift'], 1, 1);
187 187
         add_action('pre_post_update', [$this, 'pre_post_update'], 2, 1);
188
-        add_action('admin_notices', function () {
188
+        add_action('admin_notices', function() {
189 189
             if (isset($_GET['timeshift']) && $_GET['timeshift']) {
190 190
                 echo '<div class="notice notice-warning is-dismissible">
191 191
                          <p style="font-weight: 800; color: red">' . __('You are editing a historical version! if you save or publish, this will replace the current live one', 'kmm-timeshift') . '</p>
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         }
248 248
         unset($mdata['_edit_lock']);
249 249
 
250
-        $timeshift = (object) ['post' => $post, 'meta' => $mdata];
250
+        $timeshift = (object)['post' => $post, 'meta' => $mdata];
251 251
         $this->storeTimeshift($timeshift);
252 252
     }
253 253
 }
Please login to merge, or discard this patch.