Jump to content

illdefinedartistry

New Members
  • Posts

    3
  • Joined

  • Last visited

illdefinedartistry's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $page->post_title returns a string which contains the wordpress post's title.
  2. Testing with 'options' => $objects. Fills each drop down with queenlabs_admin as each option When I tested with 'options' => $keys it shows up correctly in the drop down, however it does not return the correct results. The exact comments regarding the function are: // Array of 'value' => 'Label' pairs for select box
  3. Hi guys, What I'm trying to do is convert an array that is currently hard coded, into one that is algorithmic and will dynamically change based on the number of pages on my site with the specified template. The array is a list of options that are to appear in a drop down menu. Hard code where 'Portraits' => __( 'Portraits', 'quemalabs_admin') is output => __(option title, function) : 'options' => array( 'Portraits' => __( 'Portraits', 'quemalabs_admin'), 'Concerts' => __( 'Concerts', 'quemalabs_admin' ), ) Here is what I have as the algorithmic code. This code currently outputs the correct number of options, however all of the titles display as "Array" $pages = get_pages(array( 'meta_key' => '_wp_page_template', 'meta_value' => 'page-home.php' )); foreach($pages as $page){ $keys[] = $page->post_title.'<br />'; } $objects = array_fill_keys($keys, 'quemalabs_admin'); $options = array_fill_keys($keys, $objects); ... 'options' => $options
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.