LLMS_Elementor_Migrate::migrate_post()
Migrate posts created prior to the elementor updates to have default LifterLMS widgets.
Return Return
(void)
Source Source
File: includes/class-llms-elementor-migrate.php
public function migrate_post() {
global $pagenow;
if ( 'post.php' !== $pagenow ) {
return;
}
if ( ! current_user_can( 'edit_posts' ) ) {
return;
}
$post_id = llms_filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );
$post = $post_id ? get_post( $post_id ) : false;
if ( ! $post || ! isset( $_REQUEST['action'] ) || 'elementor' !== $_REQUEST['action'] || ! $this->should_migrate_post( $post_id ) || 'course' !== get_post_type( $post_id ) ) {
return;
}
$this->ensure_elementor_data_present( $post_id );
$this->add_template_to_post( $post_id );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 7.7.0 | Introduced. |