Passed
Push — dev ( 3be0f0...ce7a97 )
by Eric
02:17
created

bitsy_content_class()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
/**
3
 * Custom functions that act independently of the theme templates.
4
 *
5
 * Eventually, some of the functionality here could be replaced by core features.
6
 *
7
 * @package bitsy
8
 */
9
/**
10
 * Adds custom classes to the array of header classes.
11
 *
12
 * @param array $classes Classes for the body element.
13
 *
14
 * @return array
15
 */
16
add_action( 'bitsy_header_class', 'bitsy_output_header_class' );
1 ignored issue
show
Bug introduced by
The function add_action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
/** @scrutinizer ignore-call */ 
17
add_action( 'bitsy_header_class', 'bitsy_output_header_class' );
Loading history...
17
function bitsy_output_header_class() {
18
	// Adds a class of alt to home and landing pages.
19
	if ( is_front_page() ) {
1 ignored issue
show
Bug introduced by
The function is_front_page was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
	if ( /** @scrutinizer ignore-call */ is_front_page() ) {
Loading history...
20
		echo 'alt';
21
	}
22
}
23
24
/**
25
 * Adds custom classes to the array of body classes.
26
 *
27
 * @param array $classes Classes for the body element.
28
 *
29
 * @return array
30
 */
31
function bitsy_body_classes( $classes ) {
32
	// Adds a class of group-blog to blogs with more than 1 published author.
33
	if ( is_multi_author() ) {
1 ignored issue
show
Bug introduced by
The function is_multi_author was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
	if ( /** @scrutinizer ignore-call */ is_multi_author() ) {
Loading history...
34
		$classes[] = 'group-blog';
35
	}
36
37
	// Adds a class of hfeed to non-singular pages.
38
	if ( ! is_singular() ) {
1 ignored issue
show
Bug introduced by
The function is_singular was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
	if ( ! /** @scrutinizer ignore-call */ is_singular() ) {
Loading history...
39
		$classes[] = 'hfeed';
40
	}
41
42
	return $classes;
43
}
44
45
add_filter( 'body_class', 'bitsy_body_classes' );
1 ignored issue
show
Bug introduced by
The function add_filter was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
/** @scrutinizer ignore-call */ 
46
add_filter( 'body_class', 'bitsy_body_classes' );
Loading history...
46
47
/**
48
 * Adds custom classes to the array of footer classes.
49
 *
50
 * @param array $classes Classes for the footer element.
51
 *
52
 * @return array
53
 */
54
add_action( 'bitsy_footer_class', 'bitsy_output_footer_class' );
55
function bitsy_output_footer_class() {
56
	// Adds a class of alt to home and landing pages.
57
	if ( is_front_page() ) {
1 ignored issue
show
Bug introduced by
The function is_front_page was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

57
	if ( /** @scrutinizer ignore-call */ is_front_page() ) {
Loading history...
58
		echo 'alt';
59
	}
60
}
61
62
/**
63
 * Add a pingback url auto-discovery header for singularly identifiable articles.
64
 */
65
function bitsy_pingback_header() {
66
	if ( is_singular() && pings_open() ) {
2 ignored issues
show
Bug introduced by
The function pings_open was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

66
	if ( is_singular() && /** @scrutinizer ignore-call */ pings_open() ) {
Loading history...
Bug introduced by
The function is_singular was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

66
	if ( /** @scrutinizer ignore-call */ is_singular() && pings_open() ) {
Loading history...
67
		echo '<link rel="pingback" href="', bloginfo( 'pingback_url' ), '">';
1 ignored issue
show
Bug introduced by
The function bloginfo was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

67
		echo '<link rel="pingback" href="', /** @scrutinizer ignore-call */ bloginfo( 'pingback_url' ), '">';
Loading history...
68
	}
69
}
70
71
add_action( 'wp_head', 'bitsy_pingback_header' );
72
73
/**
74
 * Creating theme hooks
75
 */
76
/**
77
 * Create header class hook
78
 */
79
function bitsy_header_class() {
80
	do_action( 'bitsy_header_class' );
1 ignored issue
show
Bug introduced by
The function do_action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

80
	/** @scrutinizer ignore-call */ 
81
 do_action( 'bitsy_header_class' );
Loading history...
81
}
82
83
/**
84
 * Create content class hook
85
 */
86
function bitsy_content_class() {
87
	do_action( 'bitsy_content_class' );
1 ignored issue
show
Bug introduced by
The function do_action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

87
	/** @scrutinizer ignore-call */ 
88
 do_action( 'bitsy_content_class' );
Loading history...
88
}
89
90
/**
91
 * Create footer class hook
92
 */
93
function bitsy_footer_class() {
94
	do_action( 'bitsy_footer_class' );
1 ignored issue
show
Bug introduced by
The function do_action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

94
	/** @scrutinizer ignore-call */ 
95
 do_action( 'bitsy_footer_class' );
Loading history...
95
}
96
97
/**
98
 * Declare Woo Support
99
 */
100
add_action( 'after_setup_theme', 'woocommerce_support' );
101
function woocommerce_support() {
102
	add_theme_support( 'woocommerce' );
1 ignored issue
show
Bug introduced by
The function add_theme_support was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

102
	/** @scrutinizer ignore-call */ 
103
 add_theme_support( 'woocommerce' );
Loading history...
103
}