llms_update_343_update_relationships()
Rename meta keys for parent section and parent course relationships for all LifterLMS Lessons and Sections
Contents
Description Description
Source Source
File: includes/functions/llms.functions.updates.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
User Contributed Notes User Contributed Notes
Permalink: