haxorqt
Home
Console
Upload
information
Create File
Create Folder
About
:
/
proc
/
self
/
cwd
/
wp-content
/
plugins
/
admin-columns-pro
/
classes
/
Sorting
/
Model
/
Post
/
Filename :
PageTemplate.php
back
Copy
<?php declare(strict_types=1); namespace ACP\Sorting\Model\Post; class PageTemplate extends MetaMapping { public function __construct(string $post_type, string $meta_key) { parent::__construct($meta_key, $this->get_sorted_fields($post_type)); } private function get_sorted_fields(string $post_type): array { if ( ! function_exists('get_page_templates')) { return []; } $templates = get_page_templates(null, $post_type); if ( ! $templates) { return []; } $templates = array_flip($templates); natcasesort($templates); return array_keys($templates); } }