Q:

Turn get_posts as string into an array for use in theme admin options

I am trying to add a drop down list of all posts into a theme admin section...without forklifting the theme code.
I need to pass the post title and id into the 'options'=>array() like so:
'getting-started-link-id'=>array(
    'title'=>'LINK GETTING STARTED TO:',
    'name'=>'page-option-item-getting-started-link-id',
    'options'=>array('54'=>'Post #1','23'=>'Post #2', '654'=>'Post #3',)
    'type'=>'combobox'
),   

I wrote a function that takes all the posts ID and name and turns them into a string:
function post_page_options(){
    $post_page_options = get_posts('category=orderby=title&order=asc&numberposts=');
    foreach( $post_page_options as $value ) :
        $str .= "'$value->ID'" . "=>'" . $value->post_title . "', ";
    endforeach; 
    return $str;
}

$str returns this:
        '54'=>'Post #1','23'=>'Post #2', '654'=>'Post #3',
I tried this but it does not work:
    'options'=>array( post_page_options() )

I tried turning the $str into an array() but the the array does not come out looking like the the format as in $str.
Somehow adding the results of the $str into the 'options'=> seems like the easist approach so the theme admin code will do what it is already written to do which is take the 'options'=> array and turn it into a drop down list.

A:

This...
array('54'=>'Post #1','23'=>'Post #2', '654'=>'Post #3',)

... is not a string. It is an array definition. 
All you need to do is create an array, which is what you want, and skip the string completely.
function post_page_options(){
    $post_page_options = get_posts('category=orderby=title&order=asc&numberposts=');
    foreach( $post_page_options as $value ) :
        $str[$value->ID] = $value->post_title;
    endforeach; 
    return $str;
}

