llms_update_util_rekey_meta( string $post_type, string $new_key, string $old_key )

Update the key of a postmeta item

Parameters Parameters


(string) (Required) Post type.


(string) (Required) New postmeta key.


(string) (Required) Old postmeta key.

Top ↑

Return Return


Top ↑

Source Source

File: includes/functions/llms.functions.updates.php

function llms_update_util_rekey_meta( $post_type, $new_key, $old_key ) {

	global $wpdb;

			"UPDATE {$wpdb->prefix}postmeta AS m
		 INNER JOIN {$wpdb->prefix}posts AS p ON p.ID = m.post_ID
		 SET m.meta_key = %s
	 	 WHERE p.post_type = %s AND m.meta_key = %s;",
			array( $new_key, $post_type, $old_key )
	); // no-cache ok.


Top ↑

Changelog Changelog

Version Description
3.4.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.