<?php /** * Integration file for Elementor utilities-related stuff. * * @package LearnDash\Elementor */ namespace LearnDash\Elementor; /** * Utilities integration class. * * @since 1.0.5 */ class Utilities { /** * Include the LearnDash Post Types to show when adding new Elementor Templates. * * Requires Elementor Pro 2.3.0 or higher. * * @since 1.0.5 * * @param array $post_types array of post type slugs and labels to show. * * @return array Array of post types. */ public function get_public_post_types( $post_types ): array { if ( function_exists( 'learndash_is_active_theme' ) && learndash_is_active_theme( 'ld30' ) && function_exists( 'learndash_get_post_type_slug' ) ) { $ld_post_types = [ learndash_get_post_type_slug( 'course' ) => learndash_get_custom_label( 'courses' ), learndash_get_post_type_slug( 'lesson' ) => learndash_get_custom_label( 'lessons' ), learndash_get_post_type_slug( 'topic' ) => learndash_get_custom_label( 'topics' ), learndash_get_post_type_slug( 'quiz' ) => learndash_get_custom_label( 'quizzes' ), ]; foreach ( $ld_post_types as $ld_post_type_slug => $ld_post_type_label ) { if ( ! isset( $post_types[ $ld_post_type_slug ] ) ) { $post_types[ $ld_post_type_slug ] = $ld_post_type_label; } } } return $post_types; } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Admin | Folder | 0755 |
|
|
Documents | Folder | 0755 |
|
|
Settings | Folder | 0755 |
|
|
Shortcodes | Folder | 0755 |
|
|
Utilities | Folder | 0755 |
|
|
Widgets | Folder | 0755 |
|
|
App.php | File | 238 B | 0644 |
|
Compatibility.php | File | 521 B | 0644 |
|
Container.php | File | 244 B | 0644 |
|
Dependency_Checker.php | File | 6.84 KB | 0644 |
|
Documents.php | File | 1.2 KB | 0644 |
|
Editor.php | File | 525 B | 0644 |
|
Elements.php | File | 650 B | 0644 |
|
Frontend.php | File | 6.78 KB | 0644 |
|
Plugin.php | File | 2.56 KB | 0644 |
|
Provider.php | File | 327 B | 0644 |
|
Step.php | File | 696 B | 0644 |
|
Templates.php | File | 3.63 KB | 0644 |
|
Utilities.php | File | 1.32 KB | 0644 |
|
Widgets.php | File | 3.19 KB | 0644 |
|