WPDB prepare – like % – placeholders?

Yes, they’re normal. They were added in 4.8.3 to fix an SQL injection vulnerability. You can read an article describing the technical reasons for this happening here and the ticket for the change here. The placeholder characters are replaced by the random characters on the last line of $wpdb->prepare() with the $wpdb->add_placeholder_escape() function, which calls … Read more

WP_Query post_tilte search in posts table

You added title inside $args[‘meta_query’] and that’s why your query doesn’t work. Checking the documentation (get_posts / WP_Query) you will find the available parameters, among them title and s. $args = array( ‘s’ => ‘apple’, ‘post_type’ => ‘product’ // // other parameters // ‘status`, ‘orderby’, ‘meta_query’, … ) $posts = get_posts($args); If you use the … Read more

$wpdb:insert, more arguements in $format array than in $data

I think you’re assuming this is intentional, it’s probably just a bug in the theme, what it’s stating is the 5th parameter is a string, but there is no 5th parameter so it’s ignored. The most likely reason is that during development a 5th entry was removed and the author forgot to update the second … Read more

I have an error WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version

The problem here you are passing table name as a placeholder in prepare statement. Which is not allowed. You can directly add the table name in your query without quotes. Your query do not have any placeholder and arguments. So No need for prepare statement. Try following code. global $wpdb; $vragen = $wpdb->get_results( “SELECT * … Read more