Completed
Push — beta ( feeeb7...e84093 )
by Helmut
04:06
created
src/Core.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
     public function add_metabox()
46 46
     {
47 47
         $cl = $this;
48
-        if (! isset($_GET['post']) || ! $this->hasTimeshifts($_GET['post'])) {
48
+        if ( ! isset($_GET['post']) || ! $this->hasTimeshifts($_GET['post'])) {
49 49
             return;
50 50
         }
51
-        add_action('add_meta_boxes', function () use ($cl) {
51
+        add_action('add_meta_boxes', function() use ($cl) {
52 52
             add_meta_box('krn-timeshift', __('Timeshift', 'kmm-timeshift'), [$cl, 'timeshift_metabox'], null, 'normal', 'core');
53 53
         });
54 54
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function timeshift_metabox()
57 57
     {
58 58
         global $post;
59
-        if (! isset($_GET['post'])) {
59
+        if ( ! isset($_GET['post'])) {
60 60
             return;
61 61
         }
62 62
         $prod_post = get_post($_GET['post']);
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
 
124 124
     public function inject_metadata_timeshift($value, $post_id, $key, $single)
125 125
     {
126
-        if (! isset($_GET['timeshift'])) {
126
+        if ( ! isset($_GET['timeshift'])) {
127 127
             return;
128 128
         }
129 129
         //Load timeshift
130
-        if (! $this->timeshift_cached_meta) {
130
+        if ( ! $this->timeshift_cached_meta) {
131 131
             $post_type = get_post_type($post_id);
132 132
             $table_name = $this->wpdb->prefix . 'timeshift_' . $post_type;
133 133
             $sql = "select * from $table_name where id=" . intval($_GET['timeshift']);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     public function inject_timeshift($p)
151 151
     {
152 152
         global $post;
153
-        if (! isset($_GET['timeshift'])) {
153
+        if ( ! isset($_GET['timeshift'])) {
154 154
             return;
155 155
         }
156 156
         //Load timeshift
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
         add_action('edit_form_top', [$this, 'inject_timeshift'], 1, 1);
169 169
         add_action('pre_post_update', [$this, 'pre_post_update'], 2, 1);
170
-        add_action('admin_notices', function () {
170
+        add_action('admin_notices', function() {
171 171
             if (isset($_GET['timeshift']) && $_GET['timeshift']) {
172 172
                 echo '<div class="notice notice-warning is-dismissible">
173 173
                          <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>
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $mdata['_edit_last'][0] = $this->last_author;
222 222
         unset($mdata['_edit_lock']);
223 223
 
224
-        $timeshift = (object) ['post' => $post, 'meta' => $mdata];
224
+        $timeshift = (object)['post' => $post, 'meta' => $mdata];
225 225
         $this->storeTimeshift($timeshift);
226 226
     }
227 227
 }
Please login to merge, or discard this patch.