WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wpdb->prepare() calling convention has changed (3 posts)

  1. David Lingren
    Member
    Posted 1 year ago #

    In previous releases wp-includes/wp-db.php function prepare was defined as:

    function prepare( $query = null ) { // ( $query, *$args )

    in the latest beta release the definition is

    function prepare( $query, $args ) {

    This causes PHP (!) Warning messages for any call to prepare() that does not have %s/%d substitution parameters.

  2. Sergey Biryukov
    WordPress Dev
    Posted 1 year ago #

    This is intentional, see http://core.trac.wordpress.org/ticket/22262.

    If there are no placeholders in the query, there's no reason to run it through wpdb::prepare().

  3. Andrew Nacin
    Lead Developer
    Posted 1 year ago #

    If you're a user: Your site is fine. If you're a plugin/theme author, please read: http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/. If you're a user, please point your plugin/theme author to that post.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.