• Hi.

    I’ve installed the “Contact Us Page Builder”-plugin but it won’t let me drag and drop…?
    I got this message in WP:

    arning: Missing argument 2 for wpdb::prepare(), called in C:\xampp\htdocs\wordpress\wp-content\plugins\wp-contactpage-designer\includes\template.php on line 138 and defined in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 992

    So I checked out the code-lines in template.php :

    public static function get_templates() {
            global $wpdb;
    
            $query = "SELECT * FROM <code>{$wpdb->prefix}cpd_templates</code> ";
            $templates = $wpdb->get_results( $wpdb->prepare( $query ) );
    
            return $templates;
        }

    and then the wp-db.php which states:

    function prepare( $query, $args ) {
    		if ( is_null( $query ) )
    			return;
    
    		$args = func_get_args();
    		array_shift( $args );
    		// If args were passed as an array (as in vsprintf), move them up
    		if ( isset( $args[0] ) && is_array($args[0]) )
    			$args = $args[0];
    		$query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
    		$query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
    		$query = preg_replace( '|(?<!%)%f|' , '%F', $query ); // Force floats to be locale unaware
    		$query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
    		array_walk( $args, array( $this, 'escape_by_ref' ) );
    		return @vsprintf( $query, $args );
    	}

    What am I supposed to do with which code to make this plugin function?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Plugin malfunction’ is closed to new replies.