Files
Testing/tbb/wp-content/plugins/dreamgrow-scroll-triggered-box/dgd-page-selector-walker.class.php
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

31 lines
1019 B
PHP

<?php
class Dgd_Page_Selector_Walker extends Walker_page {
private $selected_pages=array();
public function __construct($selected_pages) {
$this->selected_pages=$selected_pages;
}
/**
* Start the element output.
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $item Menu item data object.
* @param int $depth Depth of menu item. May be used for padding.
* @param array $args Additional strings.
* @return void
*/
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 )
{
if ( $depth )
$indent = str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $depth);
else
$indent = '';
$output.= '<option value="'.$item->ID.'"';
if(is_array($this->selected_pages) && in_array($item->ID, $this->selected_pages)) {
$output.= ' selected="1"';
}
$output.= '>'.$indent.$item->post_title.'</option>';
}
}