@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public static function init() { |
31 | 31 | // Add theme support and preset the theme selectors. |
32 | - add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) ); |
|
32 | + add_action('after_setup_theme', array(__CLASS__, 'add_theme_support')); |
|
33 | 33 | } // END init() |
34 | 34 | |
35 | 35 | /** |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | * @static |
41 | 41 | */ |
42 | 42 | public static function add_theme_support() { |
43 | - add_theme_support( 'auto-load-next-post', array( |
|
43 | + add_theme_support('auto-load-next-post', array( |
|
44 | 44 | 'content_container' => 'main.site-main', |
45 | 45 | 'title_selector' => 'h1.entry-title', |
46 | 46 | 'navigation_container' => 'nav.post-navigation', |
47 | 47 | 'comments_container' => 'section#comments', |
48 | - ) ); |
|
48 | + )); |
|
49 | 49 | } // END add_theme_support() |
50 | 50 | |
51 | 51 | } // END class |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly. |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | * @return string|array * |
27 | 27 | */ |
28 | 28 | function auto_load_next_post_clean($var) { |
29 | - if ( is_array( $var ) ) { |
|
30 | - return array_map( 'auto_load_next_post_clean', $var ); |
|
29 | + if (is_array($var)) { |
|
30 | + return array_map('auto_load_next_post_clean', $var); |
|
31 | 31 | } else { |
32 | - return is_scalar( $var ) ? sanitize_text_field( $var ) : $var; |
|
32 | + return is_scalar($var) ? sanitize_text_field($var) : $var; |
|
33 | 33 | } |
34 | 34 | } // END auto_load_next_post_clean() |
35 | 35 | |
@@ -40,58 +40,58 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param string $seconds Seconds in time. |
42 | 42 | */ |
43 | -function auto_load_next_post_seconds_to_words( $seconds ) { |
|
43 | +function auto_load_next_post_seconds_to_words($seconds) { |
|
44 | 44 | // Get the years. |
45 | - $years = ( intval( $seconds ) / YEAR_IN_SECONDS ) % 100; |
|
46 | - if ( $years > 1 ) { |
|
45 | + $years = (intval($seconds) / YEAR_IN_SECONDS) % 100; |
|
46 | + if ($years > 1) { |
|
47 | 47 | /* translators: Number of years */ |
48 | - return sprintf( __( '%s years', 'auto-load-next-post' ), $years ); |
|
49 | - } elseif ( $years > 0 ) { |
|
50 | - return __( 'a year', 'auto-load-next-post' ); |
|
48 | + return sprintf(__('%s years', 'auto-load-next-post'), $years); |
|
49 | + } elseif ($years > 0) { |
|
50 | + return __('a year', 'auto-load-next-post'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // Get the weeks. |
54 | - $weeks = ( intval( $seconds ) / WEEK_IN_SECONDS ) % 52; |
|
55 | - if ( $weeks > 1 ) { |
|
54 | + $weeks = (intval($seconds) / WEEK_IN_SECONDS) % 52; |
|
55 | + if ($weeks > 1) { |
|
56 | 56 | /* translators: Number of weeks */ |
57 | - return sprintf( __( '%s weeks', 'auto-load-next-post' ), $weeks ); |
|
58 | - } elseif ( $weeks > 0 ) { |
|
59 | - return __( 'a week', 'auto-load-next-post' ); |
|
57 | + return sprintf(__('%s weeks', 'auto-load-next-post'), $weeks); |
|
58 | + } elseif ($weeks > 0) { |
|
59 | + return __('a week', 'auto-load-next-post'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // Get the days. |
63 | - $days = ( intval( $seconds ) / DAY_IN_SECONDS ) % 7; |
|
64 | - if ( $days > 1 ) { |
|
63 | + $days = (intval($seconds) / DAY_IN_SECONDS) % 7; |
|
64 | + if ($days > 1) { |
|
65 | 65 | /* translators: Number of days */ |
66 | - return sprintf( __( '%s days', 'auto-load-next-post' ), $days ); |
|
67 | - } elseif ( $days > 0 ) { |
|
68 | - return __( 'a day', 'auto-load-next-post' ); |
|
66 | + return sprintf(__('%s days', 'auto-load-next-post'), $days); |
|
67 | + } elseif ($days > 0) { |
|
68 | + return __('a day', 'auto-load-next-post'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | // Get the hours. |
72 | - $hours = ( intval( $seconds ) / HOUR_IN_SECONDS ) % 24; |
|
73 | - if ( $hours > 1 ) { |
|
72 | + $hours = (intval($seconds) / HOUR_IN_SECONDS) % 24; |
|
73 | + if ($hours > 1) { |
|
74 | 74 | /* translators: Number of hours */ |
75 | - return sprintf( __( '%s hours', 'auto-load-next-post' ), $hours ); |
|
76 | - } elseif ( $hours > 0 ) { |
|
77 | - return __( 'an hour', 'auto-load-next-post' ); |
|
75 | + return sprintf(__('%s hours', 'auto-load-next-post'), $hours); |
|
76 | + } elseif ($hours > 0) { |
|
77 | + return __('an hour', 'auto-load-next-post'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // Get the minutes. |
81 | - $minutes = ( intval( $seconds ) / MINUTE_IN_SECONDS ) % 60; |
|
82 | - if ( $minutes > 1 ) { |
|
81 | + $minutes = (intval($seconds) / MINUTE_IN_SECONDS) % 60; |
|
82 | + if ($minutes > 1) { |
|
83 | 83 | /* translators: Number of minutes */ |
84 | - return sprintf( __( '%s minutes', 'auto-load-next-post' ), $minutes ); |
|
85 | - } elseif ( $minutes > 0 ) { |
|
86 | - return __( 'a minute', 'auto-load-next-post' ); |
|
84 | + return sprintf(__('%s minutes', 'auto-load-next-post'), $minutes); |
|
85 | + } elseif ($minutes > 0) { |
|
86 | + return __('a minute', 'auto-load-next-post'); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | // Get the seconds. |
90 | - $seconds = intval( $seconds ) % 60; |
|
91 | - if ( $seconds > 1 ) { |
|
90 | + $seconds = intval($seconds) % 60; |
|
91 | + if ($seconds > 1) { |
|
92 | 92 | /* translators: Number of seconds */ |
93 | - return sprintf( __( '%s seconds', 'auto-load-next-post' ), $seconds ); |
|
94 | - } elseif ( $seconds > 0 ) { |
|
95 | - return __( 'a second', 'auto-load-next-post' ); |
|
93 | + return sprintf(__('%s seconds', 'auto-load-next-post'), $seconds); |
|
94 | + } elseif ($seconds > 0) { |
|
95 | + return __('a second', 'auto-load-next-post'); |
|
96 | 96 | } |
97 | 97 | } |