label; $post_types_options = []; foreach ($post_types as $post_type => $label) { $post_types_options['single/' . $post_type] = get_post_type_object($post_type)->labels->singular_name; } return [ 'single' => [ 'label' => __('Single', 'elementor-pro'), 'options' => $post_types_options, ], 'page/404' => __('404', 'elementor-pro'), ]; } public static function get_public_post_types() { $post_types_options = []; $args = array( 'public' => true, ); $post_types = get_post_types($args, 'objects'); foreach ($post_types as $post_type) { if ('elementor_library' != $post_type->name) $post_types_options[$post_type->name] = $post_type->label; } return $post_types_options; } }