| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/aecm.ihu.gr/wp-content/plugins/learnpress/inc/Models/ |
Upload File : |
<?php
/**
* Class ListCourseCategories
*
* Handle lit course categories
*
* @package LearnPress/Classes
* @version 1.0.0
* @since 4.2.6.5
*/
namespace LearnPress\Models;
use Throwable;
class ListCourseCategories {
/**
* Get all course categories
*
* @param array $arg_query_terms
*
* @return array [ term_id => term_name ]
*/
public static function get_all_categories_id_name( array $arg_query_terms = [] ): array {
$terms = [];
try {
$arg_query_terms_default = [
'taxonomy' => LP_COURSE_CATEGORY_TAX,
'fields' => 'id=>name',
'parent' => 0,
'orderby' => 'term_order',
'order' => 'ASC',
];
$arg_query_terms = array_merge( $arg_query_terms_default, $arg_query_terms );
$terms = get_terms( $arg_query_terms );
} catch ( Throwable $e ) {
error_log( __METHOD__ . ': ' . $e->getMessage() );
}
return $terms;
}
}