Skip to content

Commit 661e8fb

Browse files
committed
Updated screenshots + minor code cleanup
1 parent 13e1b46 commit 661e8fb

File tree

3 files changed

+10
-36
lines changed

3 files changed

+10
-36
lines changed

admin.inc.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -362,24 +362,16 @@ function acc_options() {
362362

363363
/**
364364
* Add a link under Settings to the plugins settings page.
365-
*
366-
* @access public
367-
* @return void
368365
*/
369366
function acc_adminmenu() {
370-
if ( ( function_exists( 'add_options_page' ) ) ) {
371-
$plugin_page = add_options_page( __( "Auto-Close", 'autoclose' ), __( "Auto-Close", 'autoclose' ), 'manage_options', 'acc_options', 'acc_options' );
372-
add_action( 'admin_head-'. $plugin_page, 'acc_adminhead' );
373-
}
367+
$plugin_page = add_options_page( __( "Auto-Close", 'autoclose' ), __( "Auto-Close", 'autoclose' ), 'manage_options', 'acc_options', 'acc_options' );
368+
add_action( 'admin_head-'. $plugin_page, 'acc_adminhead' );
374369
}
375370
add_action( 'admin_menu', 'acc_adminmenu' );
376371

377372

378373
/**
379374
* Function to add CSS and JS to the Admin header.
380-
*
381-
* @access public
382-
* @return void
383375
*/
384376
function acc_adminhead() {
385377
wp_enqueue_script( 'common' );

ald-autoclose.php

+8-26
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636

3737
/**
3838
* Initialises text domain for l10n.
39-
*
40-
* @access public
41-
* @return void
4239
*/
4340
function ald_acc_lang_init() {
4441
load_plugin_textdomain( 'autoclose', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
@@ -163,8 +160,7 @@ function ald_acc() {
163160
/**
164161
* Default options.
165162
*
166-
* @access public
167-
* @return void
163+
* @return array Default settings
168164
*/
169165
function acc_default_options() {
170166

@@ -188,15 +184,14 @@ function acc_default_options() {
188184
'pbtb_post_types' => $pbtb_post_types, // WordPress custom post types
189185
);
190186

191-
return $acc_settings;
187+
return apply_filters( 'acc_default_options', $acc_settings );
192188
}
193189

194190

195191
/**
196192
* Function to read options from the database.
197193
*
198-
* @access public
199-
* @return void
194+
* @return array Options for the database. Will add any missing options.
200195
*/
201196
function acc_read_options() {
202197
$acc_settings_changed = false;
@@ -216,17 +211,15 @@ function acc_read_options() {
216211
update_option( 'ald_acc_settings', $acc_settings );
217212
}
218213

219-
return $acc_settings;
214+
return apply_filters( 'acc_read_options', $acc_settings );
220215
}
221216

222217

223218
/**
224219
* Function to enable run or actions.
225220
*
226-
* @access public
227-
* @param int $hour
228-
* @param int $min
229-
* @return void
221+
* @param int $hour Hour
222+
* @param int $min Min
230223
*/
231224
function acc_enable_run( $hour, $min ) {
232225
if ( ! wp_next_scheduled( 'ald_acc_hook' ) ) {
@@ -240,9 +233,6 @@ function acc_enable_run( $hour, $min ) {
240233

241234
/**
242235
* Function to disable daily run or actions.
243-
*
244-
* @access public
245-
* @return void
246236
*/
247237
function acc_disable_run() {
248238
if ( wp_next_scheduled( 'ald_acc_hook' ) ) {
@@ -254,10 +244,10 @@ function acc_disable_run() {
254244
// Process the admin page if we're on the admin screen
255245
if ( is_admin() || strstr( $_SERVER['PHP_SELF'], 'wp-admin/' ) ) {
256246
require_once( ALD_ACC_DIR . "/admin.inc.php" );
247+
257248
/**
258249
* Filter to add link to WordPress plugin action links.
259250
*
260-
* @access public
261251
* @param array $links
262252
* @return array
263253
*/
@@ -273,10 +263,8 @@ function acc_plugin_actions_links( $links ) {
273263
/**
274264
* Filter to add links to the plugin action row.
275265
*
276-
* @access public
277266
* @param array $links
278267
* @param array $file
279-
* @return void
280268
*/
281269
function acc_plugin_actions( $links, $file ) {
282270
static $plugin;
@@ -289,13 +277,7 @@ function acc_plugin_actions( $links, $file ) {
289277
}
290278
return $links;
291279
}
292-
293-
global $wp_version;
294-
if ( version_compare( $wp_version, '2.8alpha', '>' ) ) {
295-
add_filter( 'plugin_row_meta', 'acc_plugin_actions', 10, 2 ); // only 2.8 and higher
296-
} else {
297-
add_filter( 'plugin_action_links', 'acc_plugin_actions', 10, 2 );
298-
}
280+
add_filter( 'plugin_row_meta', 'acc_plugin_actions', 10, 2 ); // only 2.8 and higher
299281

300282
} // End admin.inc
301283

screenshot-1.png

11.9 KB
Loading

0 commit comments

Comments
 (0)