Skip to content

Commit f5de03a

Browse files
committed
phpcbf formatting
1 parent 0c6816c commit f5de03a

File tree

7 files changed

+20
-46
lines changed

7 files changed

+20
-46
lines changed

autoclose.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Plugin Name: Auto-Close Comments, Pingbacks and Trackbacks
1515
* Plugin URI: https://webberzone.com/plugins/autoclose/
1616
* Description: Automatically close Comments, Pingbacks and Trackbacks. Manage and delete revisions.
17-
* Version: 2.2.0
17+
* Version: 2.3.0-beta1
1818
* Author: Ajay D'Souza
1919
* Author URI: https://webberzone.com/
2020
* Text Domain: autoclose
@@ -38,7 +38,7 @@
3838
* @var string Plugin version
3939
*/
4040
if ( ! defined( 'ACC_PLUGIN_VERSION' ) ) {
41-
define( 'ACC_PLUGIN_VERSION', '2.2.0' );
41+
define( 'ACC_PLUGIN_VERSION', '2.3.0-beta1' );
4242
}
4343

4444
/**

includes/admin/class-autoclose-settings.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public function get_translation_strings() {
154154
* @param array $strings Translation strings.
155155
*/
156156
return apply_filters( self::$prefix . '_translation_strings', $strings );
157-
158157
}
159158

160159
/**
@@ -180,7 +179,6 @@ public function get_settings_sections() {
180179
* @param array $acc_settings_sections Settings array
181180
*/
182181
return apply_filters( self::$prefix . '_settings_sections', $acc_settings_sections );
183-
184182
}
185183

186184

@@ -208,7 +206,6 @@ public static function get_registered_settings() {
208206
* @param array $acc_setings Settings array
209207
*/
210208
return apply_filters( self::$prefix . '_registered_settings', $acc_settings );
211-
212209
}
213210

214211
/**
@@ -460,7 +457,6 @@ public function get_upgrade_settings() {
460457

461458
return $settings;
462459
}
463-
464460
}
465461

466462
/**
@@ -657,7 +653,6 @@ public function settings_help() {
657653
)
658654
);
659655
}
660-
661656
}
662657

663658
/**
@@ -673,7 +668,6 @@ public function settings_page_header() {
673668
</a>
674669
<p>
675670
<?php
676-
677671
}
678672

679673

@@ -698,7 +692,6 @@ public function change_settings_on_save( $settings ) {
698692

699693
return $settings;
700694
}
701-
702695
}
703696

704697
/**

includes/admin/class-settings-api.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ public function set_props( $args ) {
176176
foreach ( $args as $name => $value ) {
177177
$this->$name = $value;
178178
}
179-
180179
}
181180

182181
/**
@@ -359,7 +358,6 @@ public function admin_enqueue_scripts( $hook ) {
359358
if ( $hook === $this->settings_page ) {
360359
$this->enqueue_scripts_styles();
361360
}
362-
363361
}
364362

365363
/**
@@ -559,7 +557,6 @@ public function get_default_option( $key = '' ) {
559557
} else {
560558
return false;
561559
}
562-
563560
}
564561

565562

@@ -598,18 +595,18 @@ public function get_field_description( $args ) {
598595
* Get the value of a settings field.
599596
*
600597
* @param string $option Settings field name.
601-
* @param string $default Default text if it's not found.
598+
* @param string $default_value Default text if it's not found.
602599
* @return string
603600
*/
604-
public function get_option( $option, $default = '' ) {
601+
public function get_option( $option, $default_value = '' ) {
605602

606603
$options = get_option( $this->settings_key );
607604

608605
if ( isset( $options[ $option ] ) ) {
609606
return $options[ $option ];
610607
}
611608

612-
return $default;
609+
return $default_value;
613610
}
614611

615612
/**
@@ -792,12 +789,11 @@ public function callback_checkbox( $args ) {
792789

793790
$html = sprintf( '<input type="hidden" name="%1$s[%2$s]" value="-1" />', $this->settings_key, sanitize_key( $args['id'] ) );
794791
$html .= sprintf( '<input type="checkbox" id="%1$s[%2$s]" name="%1$s[%2$s]" value="1" %3$s />', $this->settings_key, sanitize_key( $args['id'] ), $checked );
795-
$html .= ( $value <> $default ) ? '<em style="color:orange">' . $this->translation_strings['checkbox_modified'] . '</em>' : ''; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
792+
$html .= ( $value !== $default ) ? '<em style="color:orange">' . $this->translation_strings['checkbox_modified'] . '</em>' : ''; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
796793
$html .= $this->get_field_description( $args );
797794

798795
/** This filter has been defined in class-settings-api.php */
799796
echo apply_filters( $this->prefix . '_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
800-
801797
}
802798

803799
/**
@@ -845,7 +841,6 @@ public function callback_multicheck( $args ) {
845841

846842
/** This filter has been defined in class-settings-api.php */
847843
echo apply_filters( $this->prefix . '_after_setting_output', $html, $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
848-
849844
}
850845

851846
/**
@@ -1292,15 +1287,14 @@ public function settings_sanitize( $input ) {
12921287
* @param array $input Input settings array.
12931288
*/
12941289
return apply_filters( $this->prefix . '_settings_sanitize', $output, $input );
1295-
12961290
}
12971291

12981292
/**
12991293
* Get sanitization callback for given Settings key.
13001294
*
13011295
* @param string $key Settings key.
13021296
*
1303-
* @return string|bool Callback function or false if callback isn't found.
1297+
* @return string|bool|array Callback function or false if callback isn't found.
13041298
*/
13051299
public function get_sanitize_callback( $key = '' ) {
13061300
if ( empty( $key ) ) {
@@ -1644,9 +1638,7 @@ public function settings_help() {
16441638
foreach ( $this->help_tabs as $tab ) {
16451639
$screen->add_help_tab( $tab );
16461640
}
1647-
16481641
}
1649-
16501642
}
16511643

16521644
endif;

includes/admin/options-api.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,33 @@
2222
*
2323
* @since 2.0.0
2424
*
25-
* @param string $key Option to fetch.
26-
* @param mixed $default Default option.
25+
* @param string $key Option to fetch.
26+
* @param mixed $default_value Default option.
2727
* @return mixed
2828
*/
29-
function acc_get_option( $key = '', $default = null ) {
29+
function acc_get_option( $key = '', $default_value = null ) {
3030
global $acc_settings;
3131

3232
if ( empty( $acc_settings ) ) {
3333
$acc_settings = acc_get_settings();
3434
}
3535

36-
if ( is_null( $default ) ) {
37-
$default = acc_get_default_option( $key );
36+
if ( is_null( $default_value ) ) {
37+
$default_value = acc_get_default_option( $key );
3838
}
3939

40-
$value = isset( $acc_settings[ $key ] ) ? $acc_settings[ $key ] : $default;
40+
$value = isset( $acc_settings[ $key ] ) ? $acc_settings[ $key ] : $default_value;
4141

4242
/**
4343
* Filter the value for the option being fetched.
4444
*
4545
* @since 2.0.0
4646
*
4747
* @param mixed $value Value of the option
48-
* @param mixed $key Name of the option
49-
* @param mixed $default Default value
48+
* @param mixed $key Name of the option
49+
* @param mixed $default_value Default value
5050
*/
51-
$value = apply_filters( 'acc_get_option', $value, $key, $default );
51+
$value = apply_filters( 'acc_get_option', $value, $key, $default_value );
5252

5353
/**
5454
* Key specific filter for the value of the option being fetched.
@@ -57,9 +57,9 @@ function acc_get_option( $key = '', $default = null ) {
5757
*
5858
* @param mixed $value Value of the option
5959
* @param mixed $key Name of the option
60-
* @param mixed $default Default value
60+
* @param mixed $default_value Default value
6161
*/
62-
return apply_filters( 'acc_get_option_' . $key, $value, $key, $default );
62+
return apply_filters( 'acc_get_option_' . $key, $value, $key, $default_value );
6363
}
6464

6565

@@ -202,7 +202,6 @@ function acc_get_default_option( $key = '' ) {
202202
} else {
203203
return false;
204204
}
205-
206205
}
207206

208207

@@ -276,7 +275,6 @@ function wz_tag_search() {
276275

277276
echo wp_json_encode( $results );
278277
wp_die();
279-
280278
}
281279
add_action( 'wp_ajax_wz_tag_search', 'wz_tag_search' );
282280
endif;

includes/comments.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ function acc_edit_discussions( $type = 'comment', $action = 'open', $args = arra
106106
function acc_open_discussions( $type = 'comment', $args = array() ) {
107107

108108
return acc_edit_discussions( $type, 'open', $args );
109-
110109
}
111110

112111
/**
@@ -122,7 +121,6 @@ function acc_open_discussions( $type = 'comment', $args = array() ) {
122121
function acc_close_discussions( $type = 'comment', $args = array() ) {
123122

124123
return acc_edit_discussions( $type, 'close', $args );
125-
126124
}
127125

128126

@@ -136,7 +134,6 @@ function acc_close_discussions( $type = 'comment', $args = array() ) {
136134
function acc_open_comments() {
137135

138136
return acc_edit_discussions( 'comment', 'open' );
139-
140137
}
141138

142139

@@ -150,7 +147,6 @@ function acc_open_comments() {
150147
function acc_open_pingtracks() {
151148

152149
return acc_edit_discussions( 'ping', 'open' );
153-
154150
}
155151

156152

@@ -164,7 +160,6 @@ function acc_open_pingtracks() {
164160
function acc_close_comments() {
165161

166162
return acc_edit_discussions( 'comment', 'close' );
167-
168163
}
169164

170165

@@ -178,7 +173,6 @@ function acc_close_comments() {
178173
function acc_close_pingtracks() {
179174

180175
return acc_edit_discussions( 'ping', 'close' );
181-
182176
}
183177

184178

includes/deprecated.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @since 1.0
2222
* @deprecated 2.0.0
2323
*/
24-
define( 'ALD_ACC_DIR', dirname( __FILE__ ) );
24+
define( 'ALD_ACC_DIR', __DIR__ );
2525

2626

2727
/**
@@ -43,7 +43,7 @@
4343
*
4444
* @var string
4545
*/
46-
$acc_url = plugins_url() . '/' . plugin_basename( dirname( __FILE__ ) );
46+
$acc_url = plugins_url() . '/' . plugin_basename( __DIR__ );
4747

4848

4949

uninstall.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,4 @@ function acc_delete_data() {
4848
if ( wp_next_scheduled( 'ald_acc_hook' ) ) {
4949
wp_clear_scheduled_hook( 'ald_acc_hook' );
5050
}
51-
5251
}
53-
54-

0 commit comments

Comments
 (0)