Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




has_filter [ WordPress Function ]

has_filter ( $tag, $function_to_check = false )
Parameters:
  • (string) $tag The name of the filter hook.
  • (callback) $function_to_check optional. If specified, return the priority of that function on this hook or false if not attached.
Returns:
  • (int|boolean) Optionally returns the priority on that hook for the specified function.
Defined at:



Check if any filter has been registered for a hook.

Source


<?php
function has_filter($tag$function_to_check false) {
    global 
$wp_filter;

    
$has = !empty($wp_filter[$tag]);
    if ( 
false === $function_to_check || false == $has )
        return 
$has;

    if ( !
$idx _wp_filter_build_unique_id($tag$function_to_checkfalse) )
        return 
false;

    foreach ( (array) 
array_keys($wp_filter[$tag]) as $priority ) {
        if ( isset(
$wp_filter[$tag][$priority][$idx]) )
            return 
$priority;
    }

    return 
false;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics