@@ -19,32 +19,32 @@ class ACF_Hide_Layout {
19
19
/**
20
20
* The single instance of the class.
21
21
*
22
- * @since 1.0
23
- * @access protected
22
+ * @since 1.0
23
+ * @access protected
24
24
*/
25
25
protected static $ instance = null ;
26
26
27
27
/**
28
28
* Field key.
29
29
*
30
- * @since 1.0
31
- * @access protected
30
+ * @since 1.0
31
+ * @access protected
32
32
*/
33
33
protected $ field_key = 'acf_hide_layout ' ;
34
34
35
35
/**
36
36
* Layouts that will be hidden.
37
37
*
38
- * @since 1.0
39
- * @access protected
38
+ * @since 1.0
39
+ * @access protected
40
40
*/
41
41
protected $ hidden_layouts = [];
42
42
43
43
/**
44
44
* A dummy magic method to prevent class from being cloned.
45
45
*
46
- * @since 1.0
47
- * @access public
46
+ * @since 1.0
47
+ * @access public
48
48
*/
49
49
public function __clone () {
50
50
_doing_it_wrong ( __FUNCTION__ , 'Cheatin’ huh? ' , '1.0.0 ' );
@@ -53,8 +53,8 @@ public function __clone() {
53
53
/**
54
54
* A dummy magic method to prevent class from being unserialized.
55
55
*
56
- * @since 1.0
57
- * @access public
56
+ * @since 1.0
57
+ * @access public
58
58
*/
59
59
public function __wakeup () {
60
60
_doing_it_wrong ( __FUNCTION__ , 'Cheatin’ huh? ' , '1.0.0 ' );
@@ -65,10 +65,10 @@ public function __wakeup() {
65
65
*
66
66
* Ensures only one instance is loaded or can be loaded.
67
67
*
68
- * @since 1.0
69
- * @access public
68
+ * @since 1.0
69
+ * @access public
70
70
*
71
- * @return Main instance.
71
+ * @return Main instance.
72
72
*/
73
73
public static function instance () {
74
74
if ( is_null ( self ::$ instance ) ) {
@@ -80,8 +80,8 @@ public static function instance() {
80
80
/**
81
81
* Constructor.
82
82
*
83
- * @since 1.0
84
- * @access public
83
+ * @since 1.0
84
+ * @access public
85
85
*/
86
86
public function __construct () {
87
87
@@ -94,10 +94,10 @@ public function __construct() {
94
94
/**
95
95
* Get the plugin url.
96
96
*
97
- * @since 1.0
98
- * @access public
97
+ * @since 1.0
98
+ * @access public
99
99
*
100
- * @return string
100
+ * @return string
101
101
*/
102
102
public function get_plugin_url () {
103
103
return plugin_dir_url ( $ this ->file );
@@ -106,10 +106,10 @@ public function get_plugin_url() {
106
106
/**
107
107
* Get the plugin path.
108
108
*
109
- * @since 1.0
110
- * @access public
109
+ * @since 1.0
110
+ * @access public
111
111
*
112
- * @return string
112
+ * @return string
113
113
*/
114
114
public function get_plugin_path () {
115
115
return plugin_dir_path ( $ this ->file );
@@ -118,10 +118,10 @@ public function get_plugin_path() {
118
118
/**
119
119
* Retrieve the version number of the plugin.
120
120
*
121
- * @since 1.0
122
- * @access public
121
+ * @since 1.0
122
+ * @access public
123
123
*
124
- * @return string
124
+ * @return string
125
125
*/
126
126
public function get_version () {
127
127
$ plugin_data = get_file_data ( $ this ->file , [ 'Version ' => 'Version ' ], 'plugin ' );
@@ -131,10 +131,10 @@ public function get_version() {
131
131
/**
132
132
* Get field key.
133
133
*
134
- * @since 1.0
135
- * @access public
134
+ * @since 1.0
135
+ * @access public
136
136
*
137
- * @return string Field key.
137
+ * @return string Field key.
138
138
*/
139
139
public function get_field_key () {
140
140
return $ this ->field_key ;
@@ -143,10 +143,10 @@ public function get_field_key() {
143
143
/**
144
144
* Get hidden layouts.
145
145
*
146
- * @since 1.0
147
- * @access public
146
+ * @since 1.0
147
+ * @access public
148
148
*
149
- * @return array Hidden layouts.
149
+ * @return array Hidden layouts.
150
150
*/
151
151
public function get_hidden_layouts () {
152
152
return $ this ->hidden_layouts ;
@@ -155,11 +155,11 @@ public function get_hidden_layouts() {
155
155
/**
156
156
* Set hidden layout.
157
157
*
158
- * @since 1.0
159
- * @access public
158
+ * @since 1.0
159
+ * @access public
160
160
*
161
- * @param string $field_key
162
- * @param int $row
161
+ * @param string $field_key
162
+ * @param int $row
163
163
*/
164
164
public function set_hidden_layout ( $ field_key , $ row ) {
165
165
$ this ->hidden_layouts [ $ field_key ][] = 'row- ' . $ row ;
@@ -171,12 +171,12 @@ public function set_hidden_layout( $field_key, $row ) {
171
171
* Thanks WooCommerce
172
172
* @see https://github.com/woocommerce/woocommerce/blob/master/includes/class-woocommerce.php#L304
173
173
*
174
- * @since 1.0
175
- * @access public
174
+ * @since 1.0
175
+ * @access public
176
176
*
177
- * @param string $type admin, ajax, cron or frontend.
177
+ * @param string $type admin, ajax, cron or frontend.
178
178
*
179
- * @return bool
179
+ * @return bool
180
180
*/
181
181
public function is_request ( $ type ) {
182
182
switch ( $ type ) {
@@ -194,8 +194,8 @@ public function is_request( $type ) {
194
194
/**
195
195
* Hook into actions and filters.
196
196
*
197
- * @since 1.0
198
- * @access private
197
+ * @since 1.0
198
+ * @access private
199
199
*/
200
200
private function init_hooks () {
201
201
add_action ( 'init ' , [ $ this , 'init ' ], 0 );
@@ -208,8 +208,8 @@ private function init_hooks() {
208
208
/**
209
209
* Init when WordPress Initialises.
210
210
*
211
- * @since 1.0
212
- * @access public
211
+ * @since 1.0
212
+ * @access public
213
213
*/
214
214
public function init () {
215
215
// Set up localisation.
@@ -219,8 +219,8 @@ public function init() {
219
219
/**
220
220
* Enqueue scripts.
221
221
*
222
- * @since 1.0
223
- * @access public
222
+ * @since 1.0
223
+ * @access public
224
224
*/
225
225
public function enqueue_scripts () {
226
226
$ assets_url = $ this ->get_plugin_url () . 'assets/ ' ;
@@ -235,8 +235,8 @@ public function enqueue_scripts() {
235
235
*
236
236
* admin_enqueue_scripts is to early for hidden layouts.
237
237
*
238
- * @since 1.0
239
- * @access public
238
+ * @since 1.0
239
+ * @access public
240
240
*/
241
241
public function admin_footer () {
242
242
@@ -253,8 +253,8 @@ public function admin_footer() {
253
253
/**
254
254
* Load Localisation files.
255
255
*
256
- * @since 1.0
257
- * @access public
256
+ * @since 1.0
257
+ * @access public
258
258
*/
259
259
public function load_plugin_textdomain () {
260
260
load_plugin_textdomain ( 'acf-hide-layout ' , false , plugin_basename ( dirname ( $ this ->file ) ) . '/languages ' );
@@ -263,14 +263,14 @@ public function load_plugin_textdomain() {
263
263
/**
264
264
* Remove layouts that are hidden from frontend.
265
265
*
266
- * @since 1.0
267
- * @access public
266
+ * @since 1.0
267
+ * @access public
268
268
*
269
- * @param mixed $layouts The value to preview.
270
- * @param string $post_id The post ID for this value.
271
- * @param array $field The field array.
269
+ * @param mixed $layouts The value to preview.
270
+ * @param string $post_id The post ID for this value.
271
+ * @param array $field The field array.
272
272
*
273
- * @return array $layouts
273
+ * @return array $layouts
274
274
*/
275
275
public function load_value ( $ layouts , $ post_id , $ field ) {
276
276
@@ -309,15 +309,15 @@ public function load_value( $layouts, $post_id, $field ) {
309
309
/**
310
310
* Update the field acf_hide_layout value.
311
311
*
312
- * @since 1.0
313
- * @access public
312
+ * @since 1.0
313
+ * @access public
314
314
*
315
- * @param mixed $rows The value to update.
316
- * @param string $post_id The post ID for this value.
317
- * @param array $field The field array.
318
- * @param mixed $original The original value before modification.
315
+ * @param mixed $rows The value to update.
316
+ * @param string $post_id The post ID for this value.
317
+ * @param array $field The field array.
318
+ * @param mixed $original The original value before modification.
319
319
*
320
- * @return mixed $rows
320
+ * @return mixed $rows
321
321
*/
322
322
public function update_value ( $ rows , $ post_id , $ field , $ original ) {
323
323
0 commit comments