Applying pre-production modifications
Applying pre-production modifications
Applying pre-production modifications
If you run this query manually, you should get a response like (1054, “Unknown column ‘wp_postmeta.meta_key’ in ‘where clause’”) Long story short, wp_postmeta.meta_key is not a valid column of wp_posts. You need to JOIN the postmeta table to be able to use its columns. (There are many resources out there that explain JOIN, one would … Read more
$wpdb->insert duplicating rows
Try this: <?php global $wpdb; $table_name = $wpdb->prefix.’frm_items’; $row_values = $wpdb->get_results(“SELECT * FROM {$table_name} WHERE id = 1”); echo $row_values[0]->cust_id; ?>
update_post_meta not working in template_redirect action
As it turns out, WordPress actually checks to see if the data posted matches existing data, if so, don’t do anything and return false. I was clicking my update button expecting it to just update in the database regardless, but it’s not the case: Taken from here
If the GPX file is attached to the current page you can find it with get_attached_media(), e.g. $gpx_files = get_attached_media( ‘application/gpx+xml’ ); if ( count( $gpx_files ) >= 1 ) { echo do_shortcode (‘[sgpx gpx=”‘ . wp_get_attachment_url( $gpx_files[0]->ID ) . ‘”]’); } else { echo ‘<p class=”warning”>No GPX file attached!</p>’; }
How to add virtual column in wpdb get_result statement
I found the problem. I had defined variables using the names DB_USER, DB_PASSWORD etc in my own database connection config file. I then found that wordpress already defines variables using these exact same names, which are stored in one of the files in the wp-includes directory. So my own defined variables with the same name … Read more
Well, this is some hasty copy/paste mistake in WP code while backporting features/bugfixes to older versions. Checked 4.3.22 code – it indeed contains version number 4.8.3 attached to this error message.