balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

Library.php (853B)


      1 <?php
      2 namespace welbim\Helper\Admin\Library;
      3 
      4 class Library {
      5 
      6 
      7 
      8 	public static function ElementorLibrary() {
      9 		$detoxPageslist   = get_posts(
     10 			array(
     11 				'post_type'      => 'elementor_library',
     12 				'posts_per_page' => -1,
     13 			)
     14 		);
     15 		$detoxPagesArrayt = array();
     16 		if ( ! empty( $detoxPageslist ) ) {
     17 			foreach ( $detoxPageslist as $page ) {
     18 				$detoxPagesArrayt[ $page->ID ] = $page->post_title;
     19 			}
     20 		}
     21 		return $detoxPagesArrayt;
     22 	}
     23 
     24 	public static function getAllPages() {
     25 		$args    = array(
     26 			'post_type'      => 'page',
     27 			'posts_per_page' => -1,
     28 		);
     29 		$catlist = array();
     30 		if ( $categories = get_posts( $args ) ) {
     31 			foreach ( $categories as $category ) {
     32 				(int) $catlist[ $category->ID ] = $category->post_title;
     33 			}
     34 		} else {
     35 			(int) $catlist['0'] = esc_html__( 'No Pages Found!', 'welbim-core' );
     36 		}
     37 		return $catlist;
     38 	}
     39 }