Switch language

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




_deprecated_function [ WordPress Function ]

_deprecated_function ( $function, $version, $replacement = null )
Access:
  • private
Parameters:
  • (string) $function The function that was called
  • (string) $version The version of WordPress that deprecated the function
  • (string) $replacement Optional. The function that should have been called
Uses:
Defined at:



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

There is a hook deprecated_function_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.

This function is to be used in every function that is deprecated.

Source


<?php
function _deprecated_function$function$version$replacement null ) {

    
do_action'deprecated_function_run'$function$replacement$version );

    
// Allow plugin to filter the output error trigger
    
if ( WP_DEBUG && apply_filters'deprecated_function_trigger_error'true ) ) {
        if ( ! 
is_null($replacement) )
            
trigger_errorsprintf__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function$version$replacement ) );
        else
            
trigger_errorsprintf__('%1$s 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