Switch language

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




_doing_it_wrong [ WordPress Function ]

_doing_it_wrong ( $function, $message, $version )
Access:
  • private
Parameters:
  • (string) $function The function that was called.
  • (string) $message A message explaining what has been done incorrectly.
  • (string) $version The version of WordPress where the message was added.
Uses:
Defined at:



Marks something as being incorrectly called.

There is a hook doing_it_wrong_run that will be called that can be used to get the backtrace up to what file and function called the deprecated function.

The current behavior is to trigger a user error if WP_DEBUG is true.

Source


<?php
function _doing_it_wrong$function$message$version ) {

    
do_action'doing_it_wrong_run'$function$message$version );

    
// Allow plugin to filter the output error trigger
    
if ( WP_DEBUG && apply_filters'doing_it_wrong_trigger_error'true ) ) {
        
$version is_null$version ) ? '' sprintf__'(This message was added in version %s.)' ), $version );
        
$message .= ' ' __'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
        
trigger_errorsprintf__'%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function$message$version ) );
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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