llms_update_343_update_relationships()
Rename meta keys for parent section and parent course relationships for all LifterLMS Lessons and Sections
Contents
Return Return
(void)
Source Source
File: includes/functions/updates/llms-functions-updates-343.php
function llms_update_343_update_relationships() { global $wpdb; // Update parent course key for courses and lessons. $wpdb->query( "UPDATE {$wpdb->postmeta} AS m JOIN {$wpdb->posts} AS p ON p.ID = m.post_id SET m.meta_key = '_llms_parent_course' WHERE m.meta_key = '_parent_course' AND ( p.post_type = 'lesson' OR p.post_type = 'section' );" ); // Update parent section key for lessons. $wpdb->query( "UPDATE {$wpdb->postmeta} AS m JOIN {$wpdb->posts} AS p ON p.ID = m.post_id SET m.meta_key = '_llms_parent_section' WHERE m.meta_key = '_parent_section' AND p.post_type = 'lesson';" ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.4.3 | Introduced. |