Switch language

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




_deprecated_file [ WordPress Function ]

_deprecated_file ( $file, $version, $replacement = null, $message = '' )
Access:
  • private
Parameters:
  • (string) $file The file that was included
  • (string) $version The version of WordPress that deprecated the file
  • (string) $replacement Optional. The file that should have been included based on ABSPATH
  • (string) $message Optional. A message regarding the change
Uses:
Defined at:



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

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

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

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

Source


<?php
function _deprecated_file$file$version$replacement null$message '' ) {

    
do_action'deprecated_file_included'$file$replacement$version$message );

    
// Allow plugin to filter the output error trigger
    
if ( WP_DEBUG && apply_filters'deprecated_file_trigger_error'true ) ) {
        
$message = empty( $message ) ? '' ' ' $message;
        if ( ! 
is_null$replacement ) )
            
trigger_errorsprintf__('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file$version$replacement ) . $message );
        else
            
trigger_errorsprintf__('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file$version ) . $message );
    }
}
?>

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