Skip to content

Commit b006789

Browse files
committed
Fix simple liniting issues
1 parent 1a1eeec commit b006789

File tree

1 file changed

+42
-16
lines changed

1 file changed

+42
-16
lines changed

themes/osi/inc/template-functions.php

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Adds custom classes to the array of body classes.
1010
*
1111
* @param array $classes Classes for the body element.
12+
*
1213
* @return array
1314
*/
1415
function osi_body_classes( $classes ) {
@@ -31,6 +32,8 @@ function osi_body_classes( $classes ) {
3132

3233
/**
3334
* Add a pingback url auto-discovery header for singularly identifiable articles.
35+
*
36+
* @return void
3437
*/
3538
function osi_pingback_header() {
3639
if ( is_singular() && pings_open() ) {
@@ -41,9 +44,11 @@ function osi_pingback_header() {
4144

4245

4346
/**
44-
* Gets rid of current_page_parent class mistakenly being applied to Blog pages while on Custom Post Types
45-
* via https://wordpress.org/support/topic/post-type-and-its-children-show-blog-as-the-current_page_parent
46-
*/
47+
* Gets rid of current_page_parent class mistakenly being applied to Blog pages while on Custom Post Types
48+
* via https://wordpress.org/support/topic/post-type-and-its-children-show-blog-as-the-current_page_parent
49+
*
50+
* @return boolean
51+
*/
4752
function is_blog() {
4853
global $post;
4954
$posttype = get_post_type( $post );
@@ -70,6 +75,12 @@ function fix_blog_link_on_cpt( $classes, $item, $args ) {
7075
* Use <figure> and <figcaption>
7176
*
7277
* @link http://justintadlock.com/archives/2011/07/01/captions-in-wordpress
78+
*
79+
* @param string $output The caption output. Default empty.
80+
* @param array $attr Attributes of the caption shortcode.
81+
* @param string $content The image element output.
82+
*
83+
* @return string
7384
*/
7485
function osi_caption( $output, $attr, $content ) {
7586
if ( is_feed() ) {
@@ -105,8 +116,12 @@ function osi_caption( $output, $attr, $content ) {
105116

106117

107118
/**
108-
* remove width attribute of thumbnails
109-
*/
119+
* remove width attribute of thumbnails
120+
*
121+
* @param string $html The HTML content.
122+
*
123+
* @return string
124+
*/
110125
function osi_remove_width_attribute( $html ) {
111126
$html = preg_replace( '/(width|height)="\d*"\s/', '', $html );
112127
return $html;
@@ -115,9 +130,13 @@ function osi_remove_width_attribute( $html ) {
115130
add_filter( 'image_send_to_editor', 'osi_remove_width_attribute', 10 );
116131

117132
/**
118-
* From http://wordpress.stackexchange.com/questions/115368/overide-gallery-default-link-to-settings
119-
* Default image links in gallery (not the same as image_default_link_type)
120-
*/
133+
* From http://wordpress.stackexchange.com/questions/115368/overide-gallery-default-link-to-settings
134+
* Default image links in gallery (not the same as image_default_link_type)
135+
*
136+
* @param array $settings
137+
*
138+
* @return array
139+
*/
121140
function osi_gallery_default_type_set_link( $settings ) {
122141
$settings['galleryDefaults']['link'] = 'file';
123142
return $settings;
@@ -126,14 +145,16 @@ function osi_gallery_default_type_set_link( $settings ) {
126145

127146

128147
/**
129-
* Remove the overly opinionated gallery styles
130-
*/
148+
* Remove the overly opinionated gallery styles
149+
*/
131150
add_filter( 'use_default_gallery_style', '__return_false' );
132151

133152

134153
/**
135-
* Inline Media Default assert_options
136-
*/
154+
* Inline Media Default assert_options
155+
*
156+
* @return string
157+
*/
137158
function osi_inline_media_styles() {
138159
$styles = '';
139160
if ( get_custom_header() ) {
@@ -144,6 +165,8 @@ function osi_inline_media_styles() {
144165

145166
/**
146167
* Check if we're on the license search page
168+
*
169+
* @return boolean
147170
*/
148171
if ( ! function_exists( 'is_license_search' ) ) {
149172

@@ -159,6 +182,8 @@ function is_license_search() {
159182

160183
/**
161184
* Get the license search query
185+
*
186+
* @return string
162187
*/
163188
if ( ! function_exists( 'get_license_search_query' ) ) {
164189

@@ -205,9 +230,10 @@ function osi_press_mentions_by_publication_date( $query ) {
205230
}
206231

207232
/**
208-
* Renders the "Created" and "Last modified" string for a page.
209-
*/
210-
233+
* Renders the "Created" and "Last modified" string for a page.
234+
*
235+
* @return void
236+
*/
211237
function osi_the_page_dates() {
212238
if ( is_page() && ! is_home() && ! is_front_page() ) {
213239
$max_date = '2023-02-01'; // February 1, 2023
@@ -311,7 +337,7 @@ function osi_supporters_shortcode_renderer( array $args = array() ) {
311337
$output .= '</div>';
312338
$output .= '</div>';
313339
}
314-
wp_reset_query(); // Reset the query to the original
340+
wp_reset_postdata();
315341
}
316342

317343
$output .= '</div>';

0 commit comments

Comments
 (0)