title: Wordpress: Parse error: syntax error, unexpected 'array' (T_ARRAY) site broken
body: <p>new here and a bit of a noob. was trying to add a field to a custom post type and ended up with a parse error message on all website pages. I've pasted the error message and the contractor-type.php code can anyone tell me how to fix this? I've had no luck reaching the hosting provider to do a full restore. Thanks very much for any and all suggestions. I don't have ftp access at the moment all ive been able to do is use the file manager in the hosting control panel to try to upload backed up copies of the theme files to no avail. </p>
  
  <p>Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting ')' in /home/renovant/public_html/wp-content/themes/renovantage/self-developed-plugin/contractor-type.php on line 212</p>
  
  <pre><code>    &lt;?php
  
  
  function get_contractor_info($id)
  {
      if($id==0)return;
      $p      = get_post($id);
      $infos  = get_post_custom($id);
      $return = array();
      $return['id']       = $id;
      $return['company']  = $p-&gt;post_title;
      foreach($infos as $key =&gt; $vls)
      {
          $return[$key] = $vls[0];
      }
      return $return;
  }
  add_action( 'init', 'tr_contractor_type' );
  
  
  function tr_contractor_type() {
      $labels = array(
          'name' =&gt; _x('Contractors', 'post type general name'),
          'singular_name' =&gt; _x('Contractor', 'post type singular name'),
          'add_new' =&gt; _x('Add New Contractor', 'article'),
          'add_new_item' =&gt; __('Add New Contractor'),
          'edit_item' =&gt; __('Edit Contractor'),
          'new_item' =&gt; __('New Contractor'),
          'view_item' =&gt; __('View Contractor'),
          'search_items' =&gt; __('Search Contractor'),
          'not_found' =&gt;  __('No Contractors found'),
          'not_found_in_trash' =&gt; __('No Contractors found in Trash'),
          'parent_item_colon' =&gt; ''
          );
  
      $supports = array(
          'title',
      //  'editor',
          //'author',
          'thumbnail',
          //'excerpt',
      //  'comments',
      //  'custom-fields',
      //  'trackbacks',
          'revisions'
          );
  
  
      $args = array(
          'labels' =&gt; $labels,
          'public' =&gt; true,
          'capability_type' =&gt; 'post',
          'supports' =&gt; $supports,
  
          'rewrite' =&gt; array( 'slug' =&gt; 'contractor','with_front' =&gt; false ),
          'taxonomies' =&gt; array('category')
          );
  
      register_post_type('contractor', $args);
  }
  
  
  add_action('admin_init','tr_admin_init_add_con');
  function tr_admin_init_add_con()
  {
      global $wpdb;
  
      if($_GET['act'] !='cc')return;
      $results = $wpdb-&gt;get_results(
      "SELECT * FROM ".'wpms1_contractor'." ");
  
      foreach($results as $row)
      {
          $post_title = $row-&gt;company;
          $post_content = '';
          $post_status = 'publish';
          $post_type   = 'contractor';
          $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template');
          //$post_id = wp_insert_post($postdata);
          //$post = $wpdb-&gt;get_row("select ID from {$wpdb-&gt;posts} where post_title = '{$row-&gt;company}'");
  
         if($post_id&gt;0)
         {
              update_post_meta($post_id,'address',$row-&gt;company_address);
              update_post_meta($post_id,'address2',$row-&gt;company_address2);
              update_post_meta($post_id,'city',$row-&gt;company_city);
              update_post_meta($post_id,'province',$row-&gt;company_province);
              update_post_meta($post_id,'country',$row-&gt;company_country);
              update_post_meta($post_id,'postal_code',$row-&gt;company_postal);
              update_post_meta($post_id,'owner',$row-&gt;company_owner);
              update_post_meta($post_id,'contact_name',$row-&gt;company_contact);
              update_post_meta($post_id,'phone1',$row-&gt;company_phone);
              update_post_meta($post_id,'phone2',$row-&gt;company_phone2);
              update_post_meta($post_id,'fax',$row-&gt;company_fax);
              update_post_meta($post_id,'website',$row-&gt;company_website);
              update_post_meta($post_id,'email',$row-&gt;company_email);
              update_post_meta($post_id,'email2',$row-&gt;company_email2);
              update_post_meta($post_id,'overview',$row-&gt;company_overview);
              update_post_meta($post_id,'motto',$row-&gt;company_motto);
              update_post_meta($post_id,'services',$row-&gt;company_services);
              update_post_meta($post_id,'postal_prefixes',$row-&gt;postal_prefix);
              update_post_meta($post_id,'profile_column_1_title',$row-&gt;title1);
              update_post_meta($post_id,'profile_column_1_description',$row-&gt;description1);
              update_post_meta($post_id,'profile_column_2_title',$row-&gt;title2);
              update_post_meta($post_id,'profile_column_2_description',$row-&gt;description2);
              update_post_meta($post_id,'profile_column_3_title',$row-&gt;title3);
              update_post_meta($post_id,'profile_column_3_description',$row-&gt;description3);
         }
      }
  }
  
  //hide button media
  add_action('admin_menu','tr_admin_menu_landing_hidemedia',11);
  function tr_admin_menu_landing_hidemedia()
  {
      $rs = wp_get_current_user();
      foreach((array) $rs-&gt;roles as $role)
      {
          if($role == 'subscriber')
          {
              remove_menu_page('upload.php');
          }
      }
  }
  
  function tr_landing_is_admin()
  {
      $rs = wp_get_current_user();
      foreach((array) $rs-&gt;roles as $role)
      {
          if($role == 'administrator')
          {
              return true;
          }
      }
      return false;
  }
  
  
  $profile_metaboxs =array();
  
  $Company_fields = array(
                          'address' =&gt; 'Address',
                          'address2' =&gt; 'Address2',
                          'city' =&gt; 'City',
                          'province' =&gt; 'Province',
                          'country' =&gt; 'Country',
                          'postal_code' =&gt;'Postal Code',
                          'website' =&gt; 'Website',
                          'owner' =&gt; 'Owner',
                          'contact_name' =&gt; ' Contact Name',
                          'phone1' =&gt; 'Phone 1',
                          'phone2' =&gt; 'Phone 2',
                          'fax' =&gt; 'Fax',
                          'email' =&gt; 'Email',
                          'email2' =&gt; 'Email2',
  
                          );
  $Company_fieldsb= array();
  foreach($Company_fields as $k =&gt; $f)
  {
  
      $Company_fieldsb[] = array(
                          'id'=&gt;$k,
                          'label'=&gt;"{$f}:",
                          'name'=&gt;$k,
                          'type'=&gt;"text"
                      );
  }
  
  $profile_metaboxs[] = array(
          'id'=&gt;'profile-meta-box-1',
          'title'=&gt;'Company Information',
          'page'=&gt; 'contractor',
          'context'=&gt;'normal',
          'priority'=&gt;'high',
          'fields'=&gt;$Company_fieldsb
      );
  
  $profile_metaboxs[] = array(
          'id'=&gt;'profile-meta-box-2',
          'title'=&gt;'Profile Overview',
          'page'=&gt; 'contractor',
          'context'=&gt;'normal',
          'priority'=&gt;'high',
          'fields'=&gt;array(
                       array(
                          'id'=&gt;'overview',
                          'label'=&gt;"Overview:",
                          'type'=&gt;"textarea",
                          'height' =&gt; '100px'
                      ),
                      array(
                          'id'=&gt;'motto',
                          'label'=&gt;"Motto:",
                          'type'=&gt;"textarea",
                          'height' =&gt; '100px'
                      ),
                      array(
                          'id'=&gt;'services',
                          'label'=&gt;"Services:",
                          'type'=&gt;"textarea",
                          'height' =&gt; '100px'
                      ),
                      array(
                          'id'=&gt;'postal_prefixes',
                          'label'=&gt;"Postal Prefixes:",
                          'type'=&gt;"textarea",
                          'height' =&gt; '100px',
                          'readonly' =&gt; (!tr_landing_is_admin())
                      ) 
          // LINE 212 as per comment from OP
      );
  
  $profile_metaboxs[] = array(
          'id'=&gt;'profile-meta-box-3',
          'title'=&gt;'Profile Column 1',
          'page'=&gt; 'contractor',
          'context'=&gt;'normal',
          'priority'=&gt;'high',
          'fields'=&gt;array(
                       array(
                          'id'=&gt;'profile_column_1_title',
                          'label'=&gt;"Title:",
                          'type'=&gt;"text",
                      ),
                      array(
                          'id'=&gt;'profile_column_1_image',
                          'label'=&gt;"Image:",
                          'type'=&gt;"img",
                      ),
                      array(
                          'id'=&gt;'profile_column_1_description',
                          'label'=&gt;"Description:",
                          'type'=&gt;"textarea",
                          'height' =&gt; '100px'
                      )
          )
      );
  
  
  $profile_metaboxs[] = array(
          'id'=&gt;'profile-meta-box-4',
          'title'=&gt;'Profile Column 2',
          'page'=&gt; 'contractor',
          'context'=&gt;'normal',
          'priority'=&gt;'high',
          'fields'=&gt;array(
                       array(
                          'id'=&gt;'profile_column_2_title',
                          'label'=&gt;"Title:",
                          'type'=&gt;"text",
                      ),
                      array(
                          'id'=&gt;'profile_column_2_image',
                          'label'=&gt;"Image:",
                          'type'=&gt;"img",
                      ),
                      array(
                          'id'=&gt;'profile_column_2_description',
                          'label'=&gt;"Description:",
                          'type'=&gt;"textarea",
                          'height' =&gt; '100px'
                      )
          )
      );
  
  $profile_metaboxs[] = array(
          'id'=&gt;'profile-meta-box-5',
          'title'=&gt;'Profile Column 3',
          'page'=&gt; 'contractor',
          'context'=&gt;'normal',
          'priority'=&gt;'high',
          'fields'=&gt;array(
                       array(
                          'id'=&gt;'profile_column_3_title',
                          'label'=&gt;"Title:",
                          'type'=&gt;"text",
                      ),
                      array(
                          'id'=&gt;'profile_column_3_image',
                          'label'=&gt;"Image:",
                          'type'=&gt;"img",
                      ),
                      array(
                          'id'=&gt;'profile_column_3_description',
                          'label'=&gt;"Description:",
                          'type'=&gt;"textarea",
                          'height' =&gt; '100px'
                      )
          )
      );
    $profile_metaboxs[]=array(
          'id'=&gt;'page-meta-box-6',
          'title'=&gt;'Header Box',
          'page'=&gt; 'contractor',
          'context'=&gt;'normal',
          'priority'=&gt;'high',
          'fields'=&gt;array(                
                      array(
                          'id'=&gt;"header_title",
                          'label'=&gt;"Title:",
                          'name'=&gt;"header_title",
                          'type'=&gt;"text"
                      ),
                      array(
                          'id'=&gt;"header_content",
                          'label'=&gt;"Content:",
                          'name'=&gt;"header_content",
                          'type'=&gt;"text"
                      ),
                      array(
                          'id'=&gt;"header_link_text",
                          'label'=&gt;"Text Link:",
                          'name'=&gt;"header_link_text",
                          'type'=&gt;"text"
                      ),
                      array(
                          'id'=&gt;"header_link_url",
                          'label'=&gt;"Link:",
                          'name'=&gt;"header_link_url",
                          'type'=&gt;"text"
                      ),
  
              )
      );  
  foreach ($profile_metaboxs as $meta_box) {
      $my_box = new Ant_Meta_Box($meta_box);
  }
  
  add_filter('post_row_actions', 'tr_landing_row_actions');
  function tr_landing_row_actions($actions){
    global $post;
  
      if($post-&gt;post_type == 'contractor')
      {
          $actions['referral'] = '&lt;a href="'.get_bloginfo('url').'/referral/'.$post-&gt;post_name.'" &gt;Referral&lt;/a&gt;';
      }
  
      return $actions;
  }
  </code></pre>