plugins – How to get saved elementor template list programmatically?

Question

Found my own answer.

To get the elementor template list you can use this snippets code

$args = array(
                        'post_type'      => 'elementor_library',
                        // 'posts_per_page' => 30,
                        'tabs_group' => 'library',
                        'elementor_library_type' => 'page',
                    );
                    $elementor_templates = get_posts($args);

Now, to display it as dropdown select element, you can iterate through elementor_templates

foreach ($elementor_templates as $elementor_template) {
                        echo $elementor_template->post_title;
                    }

0
Herahadi An 3 weeks 2022-07-25T19:26:10-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse