• Hi,

    I’m using the code at, https://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/ for a settings page and its pretty easy to learn the basic there.

    However, I have a dropdown setting using this code,

    $this->settings['example_select'] = array(
    		'section' => 'general',
    		'title'   => __( 'Example Select' ),
    		'desc'    => __( 'This is a description for the drop-down.' ),
    		'type'    => 'select',
    		'std'     => '',
    		'choices' => array(
    			'choice1' => 'Other Choice 1',
    			'choice2' => 'Other Choice 2',
    			'choice3' => 'Other Choice 3'
    		)
    	);

    where I want to list all the pages including their child pages(if there is) on the choices like,

    'choices' => array(
    	'choice1' => 'Home',
    	'choice2' => '-Sub-Home',
    	'choice3' => '-Sub-Home2',
            'choice4' => 'Contact-us',
            'choice4' => 'Sample Page'
    )

    Please help.
    Thank you.

Viewing 1 replies (of 1 total)
  • accounts@push

    (@accountspush)

    you’re storing thins in too many levels of arrays so when you call to them from somewhere more than often you’re not using the right code – pretty sure i reply to a similar post from you earlier today with the same answer

Viewing 1 replies (of 1 total)
  • The topic ‘How to list all pages including child pages on a wordpress api settings??’ is closed to new replies.