Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7647963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:35:36+00:00 2026-05-31T10:35:36+00:00

All, I’ve got the following code: array( ‘id’ => ‘tweet_slider’, ‘name’ => __( ‘Slide’,

  • 0

All,
I’ve got the following code:

array(
        'id'        => 'tweet_slider',
        'name'      => __( 'Slide', TB_GETTEXT_DOMAIN ),
        'desc'      => __( 'Select the icon you\'d like shown before the Tweet.', TB_GETTEXT_DOMAIN ),
        'type'      => 'select',
        'std'       => 'twitter_display_option',
        'options'   => array(
            'single_twitter'    => __( 'Show Single Tweet', TB_GETTEXT_DOMAIN ),
            'slider_twitter'    => __( 'Show Twitter Slider', TB_GETTEXT_DOMAIN ),
        )
    ),

This works fine but I’d basically like to add options to my options array dynamically. I tried to do something like this:

$menus = wp_get_nav_menus();
foreach ( $menus as $menu ) :
    $menu_options =  'single_twitter'   => __( 'Show Single Tweet', TB_GETTEXT_DOMAIN ),
endforeach;
$menu_options = (array)$menu_options;

array(
        'id'        => 'menu_options',
        'name'      => __( 'Enter in your Menu Options', TB_GETTEXT_DOMAIN ),
        'desc'      => __( 'Enter in your menu options.', TB_GETTEXT_DOMAIN ),
        'std'       => '',
        'type'      => 'select',
        'options'   =>  $menu_options,
    ),

This gives me the error:

Parse error: syntax error, unexpected T_DOUBLE_ARROW

Is there a way to go about doing something like this?? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:35:37+00:00Added an answer on May 31, 2026 at 10:35 am

    Try this:

    $menu_options = array();
    foreach ( $menus as $menu ) :
        $menu_options[] = array( 'single_twitter' => __( 'Show Single Tweet', TB_GETTEXT_DOMAIN));
    endforeach;
    

    Edit: Per the comment, you could try something like:

    foreach ( $menus as $menu ) :
        $menu_options[] = array( $menu->menu_id => __( $menu->name, TB_GETTEXT_DOMAIN));
    endforeach;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, Say I have the following bit of code: select: function(start, end, allDay) {
All, I have the following code: $fetch = mysql_query(SELECT * FROM calendar_events where event_status='booked'
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
All example AVR programs I've ever seen start with code such as the following:
All I know about the constraint is it's name ( SYS_C003415 ), but I
All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of
All, See the code below: function menu() { this.menuitem=[]; this.submenu=[]; this.menuitem[0] = $('div#sivname1'); this.menuitem[1]
All! I found strange code in LinkedBlockingQueue: private E dequeue() { // assert takeLock.isHeldByCurrentThread();
All, I have the following class so to check to see if the form
All the code/commands below are part of a PHP script that processes images from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.