_deprecated_argument [ WordPress Function ]
| Access: |
|
| Parameters: |
|
| 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_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
else
trigger_error( sprintf( __('%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
- #11386 (New _deprecated_argument() function) – WordPress Trac
At the very least, I am all for a _deprecated_argument() function. This is important , as while a plugin developer may notice changes to functions over the course ...
core.trac.wordpress.org - #11652 (Use _deprecated_argument() on get_bloginfo ...
_deprecated_argument() (#11386) is flexible enough to be used to mark ... which simplifies _deprecated_argument() a bit and makes the function a bit more ...
core.trac.wordpress.org - _deprecated_argument() WordPress function reference, arguments ...
Marks a function argument as deprecated and informs when it has been used.
queryposts.com - _deprecated_argument (WordPress Function) - WPSeek.com
WordPress lookup for _deprecated_argument, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com