Skip to content

Commit 35a93e3

Browse files
committed
Fix simple liniting issues
1 parent 80dfa64 commit 35a93e3

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

themes/osi/inc/template-functions.php

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ function osi_inline_media_styles() {
167167
* @return boolean
168168
*/
169169
if ( ! function_exists( 'is_license_search' ) ) {
170-
171170
function is_license_search() {
172-
173171
if ( ! isset( $_REQUEST['ls'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
174172
return false;
175173
}
@@ -184,9 +182,7 @@ function is_license_search() {
184182
* @return string
185183
*/
186184
if ( ! function_exists( 'get_license_search_query' ) ) {
187-
188185
function get_license_search_query() {
189-
190186
$query = isset( $_REQUEST['ls'] ) ? $_REQUEST['ls'] : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
191187

192188
$query = sanitize_text_field( $query );
@@ -196,17 +192,31 @@ function get_license_search_query() {
196192
}
197193

198194

199-
// Meta Block Field Filter Date
200-
add_filter( 'meta_field_block_get_block_content', 'osi_filter_meta_block_date_output', 10, 4 );
195+
/**
196+
* Meta Block Field Filter Date
197+
*
198+
* @param string $content The content of the block.
199+
* @param array $attributes The attributes of the block.
200+
* @param array $block The block.
201+
* @param int $post_id The post ID.
202+
*
203+
* @return string
204+
*/
201205
function osi_filter_meta_block_date_output( $content, $attributes, $block, $post_id ) {
202206
if ( is_numeric( $content ) && 8 === strlen( $content ) ) {
203207
$content = DateTime::createFromFormat( 'Ymd', $content )->format( 'M Y' );
204208
}
205209
return $content;
206210
}
211+
add_filter( 'meta_field_block_get_block_content', 'osi_filter_meta_block_date_output', 10, 4 );
207212

208-
// Order Press Mentions by Publication Date
209-
add_action( 'pre_get_posts', 'osi_press_mentions_by_publication_date' );
213+
/**
214+
* Order Press Mentions by Publication Date
215+
*
216+
* @param WP_Query $query The WP_Query instance (passed by reference).
217+
*
218+
* @return WP_Query
219+
*/
210220
function osi_press_mentions_by_publication_date( $query ) {
211221
if ( ! is_admin() && $query->is_main_query() ) {
212222
if ( is_post_type_archive( 'press-mentions' ) ) {
@@ -226,6 +236,7 @@ function osi_press_mentions_by_publication_date( $query ) {
226236
}
227237
return $query;
228238
}
239+
add_action( 'pre_get_posts', 'osi_press_mentions_by_publication_date' );
229240

230241
/**
231242
* Renders the "Created" and "Last modified" string for a page.
@@ -290,10 +301,9 @@ function osi_force_content_links_new_tab( string $content ) {
290301
*
291302
* @param array $args The shortcode arguments.
292303
*
293-
* @return void
304+
* @return string
294305
*/
295-
function osi_supporters_shortcode_renderer( array $args = array() ) {
296-
306+
function osi_supporters_shortcode_renderer( array $args = array() ): string {
297307
$per_page = isset( $args['limit'] ) ? $args['limit'] : -1;
298308

299309
// Override the main query for this specific case

0 commit comments

Comments
 (0)