| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Modules\PostTypesOrder; |
| 4 |
|
| 5 |
// no direct access allowed |
| 6 |
if (!defined('ABSPATH')) exit; |
| 7 |
|
| 8 |
/** |
| 9 |
* WP Adminify |
| 10 |
* @package WP Adminify: Post Types Order |
| 11 |
* |
| 12 |
* @author WP Adminify <support@wpadminify.com> |
| 13 |
*/ |
| 14 |
|
| 15 |
|
| 16 |
class PostTypesOrderWalker extends \Walker |
| 17 |
{ |
| 18 |
|
| 19 |
var $db_fields = array( |
| 20 |
'parent' => 'post_parent', |
| 21 |
'id' => 'ID' |
| 22 |
); |
| 23 |
|
| 24 |
|
| 25 |
function start_lvl(&$output, $depth = 0, $args = array()) |
| 26 |
{ |
| 27 |
$indent = str_repeat("\t", $depth); |
| 28 |
$output .= "\n$indent<ul class='children'>\n"; |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
function end_lvl(&$output, $depth = 0, $args = array()) |
| 33 |
{ |
| 34 |
$indent = str_repeat("\t", $depth); |
| 35 |
$output .= "$indent</ul>\n"; |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
function start_el(&$output, $page, $depth = 0, $args = array(), $id = 0) |
| 40 |
{ |
| 41 |
if ($depth) |
| 42 |
$indent = str_repeat("\t", $depth); |
| 43 |
else |
| 44 |
$indent = ''; |
| 45 |
|
| 46 |
extract($args, EXTR_SKIP); |
| 47 |
|
| 48 |
$item_details = apply_filters('the_title', $page->post_title, $page->ID); |
| 49 |
|
| 50 |
$item_details = apply_filters('adminify_pto/pto_media_item_data', $item_details, $page); |
| 51 |
|
| 52 |
$output .= $indent . '<li id="item_' . $page->ID . '"><span>' . $item_details . '</span>'; |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
function end_el(&$output, $page, $depth = 0, $args = array()) |
| 57 |
{ |
| 58 |
$output .= "</li>\n"; |
| 59 |
} |
| 60 |
} |
| 61 |
|