Passed
Push — master ( 32890d...b6d11a )
by Brian
13:10
created

sd_pagenow_exclude()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 12
rs 9.9
c 1
b 0
f 0
1
<?php
2
/**
3
 * A file for common functions.
4
 */
5
6
/**
7
 * Return an array of global $pagenow page names that should be used to exclude register_widgets.
8
 *
9
 * Used to block the loading of widgets on certain wp-admin pages to save on memory.
10
 *
11
 * @return mixed|void
12
 */
13
function sd_pagenow_exclude(){
14
	return apply_filters( 'sd_pagenow_exclude', array(
15
		'upload.php',
16
		'edit-comments.php',
17
		'edit-tags.php',
18
		'index.php',
19
		'media-new.php',
20
		'options-discussion.php',
21
		'options-writing.php',
22
		'edit.php',
23
		'themes.php',
24
		'users.php',
25
	) );
26
}
27
28
29
/**
30
 * Return an array of widget class names that should be excluded.
31
 *
32
 * Used to conditionally load widgets code.
33
 *
34
 * @return mixed|void
35
 */
36
function sd_widget_exclude(){
37
	return apply_filters( 'sd_widget_exclude', array() );
38
}