Add missing version numbers to _deprecated_argument() calls.
Remove deprecated argument from xfn_check() calls. Pass version number to deprecated_file_included, deprecated_function_run and deprecated_argument_run actions. Fixes #11386 props nacin. git-svn-id: http://svn.automattic.com/wordpress/trunk@12680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
03ed98ab17
commit
bf4a5241e1
|
@ -17,12 +17,12 @@
|
||||||
*
|
*
|
||||||
* @param mixed $file Filename of the original image, Or attachment id.
|
* @param mixed $file Filename of the original image, Or attachment id.
|
||||||
* @param int $max_side Maximum length of a single side for the thumbnail.
|
* @param int $max_side Maximum length of a single side for the thumbnail.
|
||||||
* @param mixed $deprecated Not used.
|
* @param mixed $deprecated Never used.
|
||||||
* @return string Thumbnail path on success, Error string on failure.
|
* @return string Thumbnail path on success, Error string on failure.
|
||||||
*/
|
*/
|
||||||
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
|
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '1.2' );
|
||||||
$thumbpath = image_resize( $file, $max_side, $max_side );
|
$thumbpath = image_resize( $file, $max_side, $max_side );
|
||||||
return apply_filters( 'wp_create_thumbnail', $thumbpath );
|
return apply_filters( 'wp_create_thumbnail', $thumbpath );
|
||||||
}
|
}
|
||||||
|
|
|
@ -636,13 +636,13 @@ function link_target_meta_box($link) { ?>
|
||||||
*
|
*
|
||||||
* @param string $class
|
* @param string $class
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @param mixed $deprecated Not used.
|
* @param mixed $deprecated Never used.
|
||||||
*/
|
*/
|
||||||
function xfn_check($class, $value = '', $deprecated = '') {
|
function xfn_check( $class, $value = '', $deprecated = '' ) {
|
||||||
global $link;
|
global $link;
|
||||||
|
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented
|
||||||
|
|
||||||
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
|
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
|
||||||
$rels = preg_split('/\s+/', $link_rel);
|
$rels = preg_split('/\s+/', $link_rel);
|
||||||
|
@ -689,13 +689,13 @@ function link_xfn_meta_box($link) {
|
||||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th>
|
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th>
|
||||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend>
|
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend>
|
||||||
<label for="contact">
|
<label for="contact">
|
||||||
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
|
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
|
||||||
<label for="acquaintance">
|
<label for="acquaintance">
|
||||||
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
|
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
|
||||||
<label for="friend">
|
<label for="friend">
|
||||||
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
|
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
|
||||||
<label for="friendship">
|
<label for="friendship">
|
||||||
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||||
</fieldset></td>
|
</fieldset></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -721,13 +721,13 @@ function link_xfn_meta_box($link) {
|
||||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th>
|
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th>
|
||||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
|
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
|
||||||
<label for="co-resident">
|
<label for="co-resident">
|
||||||
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
|
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label>
|
||||||
<label for="neighbor">
|
<label for="neighbor">
|
||||||
<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
|
<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label>
|
||||||
<label for="geographical">
|
<label for="geographical">
|
||||||
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
|
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||||
</fieldset></td>
|
</fieldset></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -735,22 +735,22 @@ function link_xfn_meta_box($link) {
|
||||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th>
|
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th>
|
||||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
|
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
|
||||||
<label for="child">
|
<label for="child">
|
||||||
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
|
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label>
|
||||||
<label for="kin">
|
<label for="kin">
|
||||||
<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
|
<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label>
|
||||||
<label for="parent">
|
<label for="parent">
|
||||||
<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
|
<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label>
|
||||||
<label for="sibling">
|
<label for="sibling">
|
||||||
<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
|
<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label>
|
||||||
<label for="spouse">
|
<label for="spouse">
|
||||||
<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
|
<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label>
|
||||||
<label for="family">
|
<label for="family">
|
||||||
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
|
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family'); ?> />
|
||||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||||
</fieldset></td>
|
</fieldset></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -24,7 +24,7 @@ function get_the_author($deprecated = '') {
|
||||||
global $authordata;
|
global $authordata;
|
||||||
|
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.1' );
|
||||||
|
|
||||||
return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
|
return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,10 @@ function get_the_author($deprecated = '') {
|
||||||
* @return string The author's display name, from get_the_author().
|
* @return string The author's display name, from get_the_author().
|
||||||
*/
|
*/
|
||||||
function the_author( $deprecated = '', $deprecated_echo = true ) {
|
function the_author( $deprecated = '', $deprecated_echo = true ) {
|
||||||
if ( !empty( $deprecated ) || $deprecated_echo !== true )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '1.5', $deprecated_echo !== true ? __('Use get_the_author() instead if you do not want the value echoed.') : null );
|
_deprecated_argument( __FUNCTION__, '2.1' );
|
||||||
|
if ( $deprecated_echo !== true )
|
||||||
|
_deprecated_argument( __FUNCTION__, '1.5', __('Use get_the_author() instead if you do not want the value echoed.') );
|
||||||
if ( $deprecated_echo )
|
if ( $deprecated_echo )
|
||||||
echo get_the_author();
|
echo get_the_author();
|
||||||
return get_the_author();
|
return get_the_author();
|
||||||
|
@ -184,7 +186,7 @@ function the_author_posts() {
|
||||||
*/
|
*/
|
||||||
function the_author_posts_link($deprecated = '') {
|
function the_author_posts_link($deprecated = '') {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.1' );
|
||||||
|
|
||||||
global $authordata;
|
global $authordata;
|
||||||
$link = sprintf(
|
$link = sprintf(
|
||||||
|
|
|
@ -504,11 +504,13 @@ function get_comments_link() {
|
||||||
* @since 0.71
|
* @since 0.71
|
||||||
*
|
*
|
||||||
* @param string $deprecated Not Used
|
* @param string $deprecated Not Used
|
||||||
* @param bool $deprecated Not Used
|
* @param bool $deprecated_2 Not Used
|
||||||
*/
|
*/
|
||||||
function comments_link( $deprecated = '', $deprecated = '' ) {
|
function comments_link( $deprecated = '', $deprecated_2 = '' ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '0.72' );
|
||||||
|
if ( !empty( $deprecated_2 ) )
|
||||||
|
_deprecated_argument( __FUNCTION__, '1.3' );
|
||||||
echo get_comments_link();
|
echo get_comments_link();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -553,7 +555,7 @@ function comments_number( $zero = false, $one = false, $more = false, $deprecate
|
||||||
global $id;
|
global $id;
|
||||||
|
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '1.3' );
|
||||||
|
|
||||||
$number = get_comments_number($id);
|
$number = get_comments_number($id);
|
||||||
|
|
||||||
|
|
|
@ -1513,7 +1513,7 @@ function wp_update_comment_count_now($post_id) {
|
||||||
*/
|
*/
|
||||||
function discover_pingback_server_uri( $url, $deprecated = '' ) {
|
function discover_pingback_server_uri( $url, $deprecated = '' ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.7' );
|
||||||
|
|
||||||
$pingback_str_dquote = 'rel="pingback"';
|
$pingback_str_dquote = 'rel="pingback"';
|
||||||
$pingback_str_squote = 'rel=\'pingback\'';
|
$pingback_str_squote = 'rel=\'pingback\'';
|
||||||
|
|
|
@ -867,7 +867,7 @@ function sanitize_html_class($class, $fallback){
|
||||||
*/
|
*/
|
||||||
function convert_chars($content, $deprecated = '') {
|
function convert_chars($content, $deprecated = '') {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '0.71' );
|
||||||
|
|
||||||
// Translation of invalid Unicode references range to valid range
|
// Translation of invalid Unicode references range to valid range
|
||||||
$wp_htmltranswinuni = array(
|
$wp_htmltranswinuni = array(
|
||||||
|
|
|
@ -1170,7 +1170,7 @@ function do_enclose( $content, $post_ID ) {
|
||||||
*/
|
*/
|
||||||
function wp_get_http( $url, $file_path = false, $deprecated = false ) {
|
function wp_get_http( $url, $file_path = false, $deprecated = false ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.7' );
|
||||||
|
|
||||||
@set_time_limit( 60 );
|
@set_time_limit( 60 );
|
||||||
|
|
||||||
|
@ -1215,7 +1215,7 @@ function wp_get_http( $url, $file_path = false, $deprecated = false ) {
|
||||||
*/
|
*/
|
||||||
function wp_get_http_headers( $url, $deprecated = false ) {
|
function wp_get_http_headers( $url, $deprecated = false ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.7' );
|
||||||
|
|
||||||
$response = wp_remote_head( $url );
|
$response = wp_remote_head( $url );
|
||||||
|
|
||||||
|
@ -2153,14 +2153,14 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param null $deprecated Not used. Set to null.
|
* @param null $deprecated Never used. Set to null.
|
||||||
* @param mixed $bits File content
|
* @param mixed $bits File content
|
||||||
* @param string $time Optional. Time formatted in 'yyyy/mm'.
|
* @param string $time Optional. Time formatted in 'yyyy/mm'.
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
|
function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.0' );
|
||||||
|
|
||||||
if ( empty( $name ) )
|
if ( empty( $name ) )
|
||||||
return array( 'error' => __( 'Empty filename' ) );
|
return array( 'error' => __( 'Empty filename' ) );
|
||||||
|
@ -2961,24 +2961,26 @@ function atom_service_url_filter($url)
|
||||||
* This function is to be used in every function in depreceated.php
|
* This function is to be used in every function in depreceated.php
|
||||||
*
|
*
|
||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @package Debug
|
* @subpackage Debug
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
* @uses do_action() Calls 'deprecated_function_run' and passes the function name and what to use instead.
|
* @uses do_action() Calls 'deprecated_function_run' and passes the function name, what to use instead,
|
||||||
* @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
|
* and the version the function was deprecated in.
|
||||||
|
* @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do
|
||||||
|
* trigger or false to not trigger error.
|
||||||
*
|
*
|
||||||
* @param string $function The function that was called
|
* @param string $function The function that was called
|
||||||
* @param string $version The version of WordPress that deprecated the function
|
* @param string $version The version of WordPress that deprecated the function
|
||||||
* @param string $replacement Optional. The function that should have been called
|
* @param string $replacement Optional. The function that should have been called
|
||||||
*/
|
*/
|
||||||
function _deprecated_function($function, $version, $replacement=null) {
|
function _deprecated_function( $function, $version, $replacement=null ) {
|
||||||
|
|
||||||
do_action('deprecated_function_run', $function, $replacement);
|
do_action( 'deprecated_function_run', $function, $replacement, $version );
|
||||||
|
|
||||||
// Allow plugin to filter the output error trigger
|
// Allow plugin to filter the output error trigger
|
||||||
if( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true )) {
|
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
|
||||||
if( !is_null($replacement) )
|
if ( ! is_null($replacement) )
|
||||||
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
|
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
|
||||||
else
|
else
|
||||||
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
|
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
|
||||||
|
@ -2997,24 +2999,26 @@ function _deprecated_function($function, $version, $replacement=null) {
|
||||||
* This function is to be used in every file that is depreceated
|
* This function is to be used in every file that is depreceated
|
||||||
*
|
*
|
||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @package Debug
|
* @subpackage Debug
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
* @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead.
|
* @uses do_action() Calls 'deprecated_file_included' and passes the file name, what to use instead,
|
||||||
* @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
|
* and the version in which the file was deprecated.
|
||||||
|
* @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do
|
||||||
|
* trigger or false to not trigger error.
|
||||||
*
|
*
|
||||||
* @param string $file The file that was included
|
* @param string $file The file that was included
|
||||||
* @param string $version The version of WordPress that deprecated the file
|
* @param string $version The version of WordPress that deprecated the file
|
||||||
* @param string $replacement Optional. The file that should have been included based on ABSPATH
|
* @param string $replacement Optional. The file that should have been included based on ABSPATH
|
||||||
*/
|
*/
|
||||||
function _deprecated_file($file, $version, $replacement=null) {
|
function _deprecated_file( $file, $version, $replacement = null ) {
|
||||||
|
|
||||||
do_action('deprecated_file_included', $file, $replacement);
|
do_action( 'deprecated_file_included', $file, $replacement, $version );
|
||||||
|
|
||||||
// Allow plugin to filter the output error trigger
|
// Allow plugin to filter the output error trigger
|
||||||
if( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
|
if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
|
||||||
if( !is_null($replacement) )
|
if ( ! is_null( $replacement ) )
|
||||||
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
|
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
|
||||||
else
|
else
|
||||||
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) );
|
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) );
|
||||||
|
@ -3029,7 +3033,7 @@ function _deprecated_file($file, $version, $replacement=null) {
|
||||||
* For example:
|
* For example:
|
||||||
* <code>
|
* <code>
|
||||||
* if ( !empty($deprecated) )
|
* if ( !empty($deprecated) )
|
||||||
* _deprecated_argument( __FUNCTION__, '0.0' );
|
* _deprecated_argument( __FUNCTION__, '3.0' );
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* There is a hook deprecated_argument_run that will be called that can be used
|
* There is a hook deprecated_argument_run that will be called that can be used
|
||||||
|
@ -3039,24 +3043,26 @@ function _deprecated_file($file, $version, $replacement=null) {
|
||||||
* The current behavior is to trigger an user error if WP_DEBUG is true.
|
* The current behavior is to trigger an user error if WP_DEBUG is true.
|
||||||
*
|
*
|
||||||
* @package WordPress
|
* @package WordPress
|
||||||
* @package Debug
|
* @subpackage Debug
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
* @uses do_action() Calls 'deprecated_argument_run' and passes the function name and what to use instead.
|
* @uses do_action() Calls 'deprecated_argument_run' and passes the function name, a message on the change,
|
||||||
* @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
|
* and the version in which the argument was deprecated.
|
||||||
|
* @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do
|
||||||
|
* trigger or false to not trigger error.
|
||||||
*
|
*
|
||||||
* @param string $function The function that was called
|
* @param string $function The function that was called
|
||||||
* @param string $version The version of WordPress that deprecated the argument used
|
* @param string $version The version of WordPress that deprecated the argument used
|
||||||
* @param string $message Optional. A message regarding the change.
|
* @param string $message Optional. A message regarding the change.
|
||||||
*/
|
*/
|
||||||
function _deprecated_argument($function, $version, $message = null) {
|
function _deprecated_argument( $function, $version, $message = null ) {
|
||||||
|
|
||||||
do_action('deprecated_argument_run', $function, $message);
|
do_action( 'deprecated_argument_run', $function, $message );
|
||||||
|
|
||||||
// Allow plugin to filter the output error trigger
|
// Allow plugin to filter the output error trigger
|
||||||
if( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
|
if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
|
||||||
if( !is_null($message) )
|
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 ) );
|
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
|
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 ) );
|
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 ) );
|
||||||
|
|
|
@ -1196,9 +1196,14 @@ function kses_init() {
|
||||||
add_action('init', 'kses_init');
|
add_action('init', 'kses_init');
|
||||||
add_action('set_current_user', 'kses_init');
|
add_action('set_current_user', 'kses_init');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inline CSS filter
|
||||||
|
*
|
||||||
|
* @since 2.8.1
|
||||||
|
*/
|
||||||
function safecss_filter_attr( $css, $deprecated = '' ) {
|
function safecss_filter_attr( $css, $deprecated = '' ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.8.1' ); // Never implemented
|
||||||
|
|
||||||
$css = wp_kses_no_null($css);
|
$css = wp_kses_no_null($css);
|
||||||
$css = str_replace(array("\n","\r","\t"), '', $css);
|
$css = str_replace(array("\n","\r","\t"), '', $css);
|
||||||
|
|
|
@ -170,7 +170,7 @@ function get_permalink($id = 0, $leavename = false) {
|
||||||
*/
|
*/
|
||||||
function post_permalink( $post_id = 0, $deprecated = '' ) {
|
function post_permalink( $post_id = 0, $deprecated = '' ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '1.3' );
|
||||||
|
|
||||||
return get_permalink($post_id);
|
return get_permalink($post_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -903,7 +903,7 @@ function walk_page_dropdown_tree() {
|
||||||
*/
|
*/
|
||||||
function the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
|
function the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
|
||||||
if ( !empty( $deprecated ) )
|
if ( !empty( $deprecated ) )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.5' );
|
||||||
|
|
||||||
if ( $fullsize )
|
if ( $fullsize )
|
||||||
echo wp_get_attachment_link($id, 'full', $permalink);
|
echo wp_get_attachment_link($id, 'full', $permalink);
|
||||||
|
|
|
@ -985,7 +985,7 @@ function is_active_sidebar( $index ) {
|
||||||
*/
|
*/
|
||||||
function wp_get_sidebars_widgets($deprecated = true) {
|
function wp_get_sidebars_widgets($deprecated = true) {
|
||||||
if ( $deprecated !== true )
|
if ( $deprecated !== true )
|
||||||
_deprecated_argument( __FUNCTION__, '0.0' );
|
_deprecated_argument( __FUNCTION__, '2.8.1' );
|
||||||
|
|
||||||
global $wp_registered_widgets, $wp_registered_sidebars, $_wp_sidebars_widgets;
|
global $wp_registered_widgets, $wp_registered_sidebars, $_wp_sidebars_widgets;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue