su_is_media_taxonomy

The shortcodes-ultimate su is media taxonomy function.

Published Date - February 15, 2021

Description

Helper function to determine if a given taxonomy is attached to the 'attachment' post type

su_is_media_taxonomy( $taxonomy );

Parameters

  1. $taxonomy


Usage

The following example is for adding a hook callback.

if ( !function_exists( 'su_is_media_taxonomy' ) ) {
    require_once ABSPATH . PLUGINDIR . 'shortcodes-ultimateshortcodes-ultimate/includes/functions-galleries.php';
}

// The input(s). 
$taxonomy = null;

// NOTICE! Understand what this does before running.
$result = su_is_media_taxonomy( $taxonomy );
            

Defined

The function is defined in the following location(s).

shortcodes-ultimate/includes/functions-galleries.php

function su_is_media_taxonomy( $taxonomy ) {

	$taxonomy = get_taxonomy( $taxonomy );

	return isset( $taxonomy->object_type ) && in_array( 'attachment', $taxonomy->object_type, true );

}