WordPress.org

Ready to get started?Download WordPress

Forums

How to list all pages including child pages on a wordpress api settings?? (2 posts)

  1. chibib0
    Member
    Posted 2 years ago #

    Hi,

    I'm using the code at, http://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.

  2. accounts@push
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic