Switch language

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




is_wp_error [ WordPress Function ]

is_wp_error ( $thing )
Parameters:
  • (mixed) $thing Check if unknown variable is WordPress Error object.
Returns:
  • (bool) True, if WP_Error. False, if not WP_Error.
Defined at:



Check whether variable is a WordPress Error.

Looks at the object and if a WP_Error class. Does not check to see if the parent is also WP_Error, so can't inherit WP_Error and still use this function.

Source


<?php
function is_wp_error($thing) {
    if ( 
is_object($thing) && is_a($thing'WP_Error') )
        return 
true;
    return 
false;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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