Switch language

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




_deprecated_argument [ WordPress Function ]

_deprecated_argument ( $function, $version, $message = null )
Access:
  • private
Parameters:
  • (string) $function The function that was called
  • (string) $version The version of WordPress that deprecated the argument used
  • (string) $message Optional. A message regarding the change.
Uses:
Defined at:



Marks a function argument as deprecated and informs when it has been used.

This function is to be used whenever a deprecated function argument is used. Before this function is called, the argument must be checked for whether it was used by comparing it to its default value or evaluating whether it is empty. For example:

if ( !empty($deprecated) )
    _deprecated_argument( __FUNCTION__, '3.0' );

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

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

Source


<?php
function _deprecated_argument$function$version$message null ) {

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

    
// Allow plugin to filter the output error trigger
    
if ( WP_DEBUG && apply_filters'deprecated_argument_trigger_error'true ) ) {
        if ( ! 
is_null$message ) )
            
trigger_errorsprintf__('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function$version$message ) );
        else
            
trigger_errorsprintf__('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function$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