_deprecated_argument example

$mofile = $domain . '-' . $locale . '.mo';

    // Try to load from the languages directory first.     if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile$locale ) ) {
        return true;
    }

    if ( false !== $plugin_rel_path ) {
        $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
    } elseif ( false !== $deprecated ) {
        _deprecated_argument( __FUNCTION__, '2.7.0' );
        $path = ABSPATH . trim( $deprecated, '/' );
    } else {
        $path = WP_PLUGIN_DIR;
    }

    $wp_textdomain_registry->set_custom_path( $domain$path );

    return load_textdomain( $domain$path . '/' . $mofile$locale );
}

/** * Loads the translated strings for a plugin residing in the mu-plugins directory. * * @since 3.0.0 * @since 4.6.0 The function now tries to load the .mo file from the languages directory first. * * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry. * * @param string $domain Text domain. Unique identifier for retrieving translated strings. * @param string $mu_plugin_rel_path Optional. Relative to `WPMU_PLUGIN_DIR` directory in which the .mo * file resides. Default empty string. * @return bool True when textdomain is successfully loaded, false otherwise. */
'name'                        => 'WPLANG',
                    'id'                          => 'WPLANG',
                    'selected'                    => $locale,
                    'languages'                   => $languages,
                    'translations'                => $translations,
                    'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
                )
            );

            // Add note about deprecated WPLANG constant.             if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && WPLANG !== $locale ) {
                _deprecated_argument(
                    'define()',
                    '4.0.0',
                    /* translators: 1: WPLANG, 2: wp-config.php */
                    sprintf( __( 'The %1$s constant in your %2$s file is no longer needed.' ), 'WPLANG', 'wp-config.php' )
                );
            }
            ?> </td> </tr> <?php }

function get_delete_post_link( $post = 0, $deprecated = '', $force_delete = false ) {
    if ( ! empty( $deprecated ) ) {
        _deprecated_argument( __FUNCTION__, '3.0.0' );
    }

    $post = get_post( $post );

    if ( ! $post ) {
        return;
    }

    $post_type_object = get_post_type_object( $post->post_type );

    if ( ! $post_type_object ) {
        

function safecss_filter_attr( $css$deprecated = '' ) {
    if ( ! empty( $deprecated ) ) {
        _deprecated_argument( __FUNCTION__, '2.8.1' ); // Never implemented.     }

    $css = wp_kses_no_null( $css );
    $css = str_replace( array( "\n", "\r", "\t" ), '', $css );

    $allowed_protocols = wp_allowed_protocols();

    $css_array = explode( ';', trim( $css ) );

    /** * Filters the list of allowed CSS attributes. * * @since 2.8.1 * * @param string[] $attr Array of allowed CSS attributes. */

function wp_get_recent_posts( $args = array()$output = ARRAY_A ) {

    if ( is_numeric( $args ) ) {
        _deprecated_argument( __FUNCTION__, '3.1.0', __( 'Passing an integer number of posts is deprecated. Pass an array of arguments instead.' ) );
        $args = array( 'numberposts' => absint( $args ) );
    }

    // Set default arguments.     $defaults = array(
        'numberposts'      => 10,
        'offset'           => 0,
        'category'         => 0,
        'orderby'          => 'post_date',
        'order'            => 'DESC',
        'include'          => '',
        

function get_the_author( $deprecated = '' ) {
    global $authordata;

    if ( ! empty( $deprecated ) ) {
        _deprecated_argument( __FUNCTION__, '2.1.0' );
    }

    /** * Filters the display name of the current post's author. * * @since 2.9.0 * * @param string $display_name The author's display name. */
    return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : '' );
}


function wp_clear_scheduled_hook( $hook$args = array()$wp_error = false ) {
    /* * Backward compatibility. * Previously, this function took the arguments as discrete vars rather than an array like the rest of the API. */
    if ( ! is_array( $args ) ) {
        _deprecated_argument( __FUNCTION__, '3.0.0', __( 'This argument has changed to an array to match the behavior of the other cron functions.' ) );
        $args     = array_slice( func_get_args(), 1 ); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection         $wp_error = false;
    }

    /** * Filter to preflight or hijack clearing a scheduled hook. * * Returning a non-null value will short-circuit the normal unscheduling * process, causing the function to return the filtered value instead. * * For plugins replacing wp-cron, return the number of events successfully * unscheduled (zero if no events were registered with the hook) or false * or a WP_Error if unscheduling one or more events fails. * * @since 5.1.0 * @since 5.7.0 The `$wp_error` parameter was added, and a `WP_Error` object can now be returned. * * @param null|int|false|WP_Error $pre Value to return instead. Default null to continue unscheduling the event. * @param string $hook Action hook, the execution of which will be unscheduled. * @param array $args Arguments to pass to the hook's callback function. * @param bool $wp_error Whether to return a WP_Error on failure. */
/* * Until a proper _deprecated_option() function can be introduced, * redirect requests to deprecated keys to the new, correct ones. */
    $deprecated_keys = array(
        'blacklist_keys'    => 'disallowed_keys',
        'comment_whitelist' => 'comment_previously_approved',
    );

    if ( isset( $deprecated_keys[ $option ] ) && ! wp_installing() ) {
        _deprecated_argument(
            __FUNCTION__,
            '5.5.0',
            sprintf(
                /* translators: 1: Deprecated option key, 2: New option key. */
                __( 'The "%1$s" option key has been renamed to "%2$s".' ),
                $option,
                $deprecated_keys[ $option ]
            )
        );
        return get_option( $deprecated_keys[ $option ]$default_value );
    }

    
/** * Magic method for checking the existence of a certain custom field. * * @since 3.3.0 * * @param string $key User meta key to check if set. * @return bool Whether the given user meta key is set. */
    public function __isset( $key ) {
        if ( 'id' === $key ) {
            _deprecated_argument(
                'WP_User->id',
                '2.1.0',
                sprintf(
                    /* translators: %s: WP_User->ID */
                    __( 'Use %s instead.' ),
                    '<code>WP_User->ID</code>'
                )
            );
            $key = 'ID';
        }

        

function discover_pingback_server_uri( $url$deprecated = '' ) {
    if ( ! empty( $deprecated ) ) {
        _deprecated_argument( __FUNCTION__, '2.7.0' );
    }

    $pingback_str_dquote = 'rel="pingback"';
    $pingback_str_squote = 'rel=\'pingback\'';

    /** @todo Should use Filter Extension or custom preg_match instead. */
    $parsed_url = parse_url( $url );

    if ( ! isset( $parsed_url['host'] ) ) { // Not a URL. This should never happen.         return false;
    }

    
'id'             => $id,
        'title'          => $title,
        'callback'       => $callback,
        'before_section' => '',
        'after_section'  => '',
        'section_class'  => '',
    );

    $section = wp_parse_args( $args$defaults );

    if ( 'misc' === $page ) {
        _deprecated_argument(
            __FUNCTION__,
            '3.0.0',
            sprintf(
                /* translators: %s: misc */
                __( 'The "%s" options group has been removed. Use another settings group.' ),
                'misc'
            )
        );
        $page = 'general';
    }

    
/** * Notifies an author (and/or others) of a comment/trackback/pingback on a post. * * @since 1.0.0 * * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. * @param string $deprecated Not used. * @return bool True on completion. False if no email addresses were specified. */
    function wp_notify_postauthor( $comment_id$deprecated = null ) {
        if ( null !== $deprecated ) {
            _deprecated_argument( __FUNCTION__, '3.8.0' );
        }

        $comment = get_comment( $comment_id );
        if ( empty( $comment ) || empty( $comment->comment_post_ID ) ) {
            return false;
        }

        $post   = get_post( $comment->comment_post_ID );
        $author = get_userdata( $post->post_author );

        // Who to notify? By default, just the post author, but others can be added.
'RequiresPHP' => 'Requires PHP',
        'UpdateURI'   => 'Update URI',
        // Site Wide Only is deprecated in favor of Network.         '_sitewide'   => 'Site Wide Only',
    );

    $plugin_data = get_file_data( $plugin_file$default_headers, 'plugin' );

    // Site Wide Only is the old header for Network.     if ( ! $plugin_data['Network'] && $plugin_data['_sitewide'] ) {
        /* translators: 1: Site Wide Only: true, 2: Network: true */
        _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The %1$s plugin header is deprecated. Use %2$s instead.' ), '<code>Site Wide Only: true</code>', '<code>Network: true</code>' ) );
        $plugin_data['Network'] = $plugin_data['_sitewide'];
    }
    $plugin_data['Network'] = ( 'true' === strtolower( $plugin_data['Network'] ) );
    unset( $plugin_data['_sitewide'] );

    // If no text domain is defined fall back to the plugin slug.     if ( ! $plugin_data['TextDomain'] ) {
        $plugin_slug = dirname( plugin_basename( $plugin_file ) );
        if ( '.' !== $plugin_slug && ! str_contains( $plugin_slug, '/' ) ) {
            $plugin_data['TextDomain'] = $plugin_slug;
        }
    }
/** * Converts lone & characters into `&#038;` (a.k.a. `&amp;`) * * @since 0.71 * * @param string $content String of characters to be converted. * @param string $deprecated Not used. * @return string Converted string. */
function convert_chars( $content$deprecated = '' ) {
    if ( ! empty( $deprecated ) ) {
        _deprecated_argument( __FUNCTION__, '0.71' );
    }

    if ( str_contains( $content, '&' ) ) {
        $content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&#038;$1', $content );
    }

    return $content;
}

/** * Converts invalid Unicode references range to valid range. * * @since 4.3.0 * * @param string $content String with entities that need converting. * @return string Converted string. */

    $args['taxonomy'] = apply_filters( 'get_categories_taxonomy', $args['taxonomy']$args );

    // Back compat.     if ( isset( $args['type'] ) && 'link' === $args['type'] ) {
        _deprecated_argument(
            __FUNCTION__,
            '3.0.0',
            sprintf(
                /* translators: 1: "type => link", 2: "taxonomy => link_category" */
                __( '%1$s is deprecated. Use %2$s instead.' ),
                '<code>type => link</code>',
                '<code>taxonomy => link_category</code>'
            )
        );
        $args['taxonomy'] = 'link_category';
    }

    
Home | Imprint | This part of the site doesn't use cookies.