ALNP_Twenty_Thirteen::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 10
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
/**
3
 * Auto Load Next Post Theme Support: Twenty Thirteen
4
 *
5
 * Applies support for WordPress Twenty Thirteen Theme.
6
 *
7
 * @since    1.5.0
8
 * @author   Sébastien Dumont
9
 * @category Theme Support
10
 * @package  Auto Load Next Post/Theme Support
11
 * @license  GPL-2.0+
12
 */
13
14
// Exit if accessed directly.
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
/**
20
 * ALNP_Twenty_Thirteen class.
21
 */
22
class ALNP_Twenty_Thirteen {
23
24
	/**
25
	 * Initlize Theme.
26
	 *
27
	 * @access public
28
	 * @static
29
	 */
30 View Code Duplication
	public static function init() {
31
		// This removes the default post navigation in the repeater template.
32
		remove_action( 'alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10 );
33
34
		// Add a compaitable post navigation.
35
		add_action( 'alnp_load_after_content', array( __CLASS__, 'alnp_twentythirteen_post_navigation' ), 1, 10 );
36
37
		// Add theme support and preset the theme selectors.
38
		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
39
	} // END init()
40
41
	/**
42
	 * Adds a compaitable post navigation.
43
	 *
44
	 * @access public
45
	 * @static
46
	 */
47
	public static function alnp_twentythirteen_post_navigation() {
48
		twentythirteen_post_nav();
49
	} // END alnp_twentythirteen_post_navigation()
50
51
	/**
52
	 * Add theme support by providing the theme selectors
53
	 * to be applied once the theme is activated.
54
	 *
55
	 * @access public
56
	 * @static
57
	 */
58
	public static function add_theme_support() {
59
		add_theme_support( 'auto-load-next-post', array(
60
			'content_container'    => '#content',
61
			'title_selector'       => 'h1.entry-title',
62
			'navigation_container' => 'nav.post-navigation',
63
			'comments_container'   => 'div#comments',
64
			'load_js_in_footer'    => 'no',
65
			'lock_js_in_footer'    => 'no',
66
		) );
67
	} // END add_theme_support()
68
69
} // END class
70
71
ALNP_Twenty_Thirteen::init();
72