Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions themes/osi/inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @return void
*/
function osi_posted_on( string $format = '' ) {

$time_string = '<time class="byline--date entry-date published" datetime="%1$s">%2$s</time>';

// Don't display the updated date for blog posts and meeting-minutes.
Expand Down Expand Up @@ -162,6 +161,7 @@ function osi_linked_logo( string $class_name = 'header-logo', string $size = 'la
*
* @param string $class_name The class name for the logo.
* @param string $size The size of the logo.
* @param string $path The path to link to.
*
* @return string The HTML string for the linked logo.
*/
Expand All @@ -173,9 +173,13 @@ function osi_get_linked_logo( string $class_name = 'header-logo', string $size =
}

/**
* Check Block Registry if a block exists
*/
function osi_check_block_registry( $name ) {
* Check Block Registry if a block exists
*
* @param string $name The block name.
*
* @return boolean
*/
function osi_check_block_registry( $name ) { // phpcs:ignore
// return 1 or nothing
return WP_Block_Type_Registry::get_instance()->is_registered( $name );
}
Expand Down Expand Up @@ -424,7 +428,6 @@ function osi_get_single_taxonomy_terms_query( \WP_Post $post, string $taxonomy_s
* @return string
*/
function osi_get_terms_from_taxonomy_links_all( string $tax = '' ) {

$terms = get_terms( $tax );

if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
Expand Down Expand Up @@ -459,7 +462,6 @@ function osi_get_terms_from_taxonomy_links_all( string $tax = '' ) {
* @return string
*/
function osi_get_terms_from_taxonomy_checkboxes( string $tax = '' ) {

$terms = get_terms( $tax );

if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
Expand Down Expand Up @@ -581,7 +583,7 @@ function osi_taxonomy_query( string $posttype = 'post', int $perpage = 6, string
}

/**
* kses ruleset for SVG escaping
* The kses ruleset for SVG escaping.
*
* @return array
*/
Expand Down Expand Up @@ -790,12 +792,17 @@ function ( $obj ) {
* Default 'Hosted by Pressable.'
* }
*
* @param array $args An associative array of arguments.
* @param array|string $args An associative array of arguments.
*
* @return void
*/
function osi_credits( array $args = array() ) {
$args = wp_parse_args(
function osi_credits( $args = array() ) {
// If args are not an array, convert to array.
if ( ! is_array( $args ) ) {
$args = (array) $args;
}

$args = wp_parse_args(
$args,
array(
'separator' => ' ',
Expand All @@ -805,7 +812,6 @@ function osi_credits( array $args = array() ) {
'pressable' => sprintf( __( 'Hosted by %s.', 'osi' ), 'Pressable' ),
)
);

$credit_links = array();

if ( $args['wpcom'] ) {
Expand Down