$sec){ if( in_array($sec['id'], $backupArray) ){ if($sec['id']=='pwa-for-wp'){ $pwaField = $sec['fields']; unset($sections[$key]); } if($sec['id']=='amp-performance'){ $sec['fields'] = array_merge($sec['fields'], $pwaField); } $seoSection[] = $sec; unset($sections[$key]); } if( in_array($sec['id'], $unsetArray) ){ $sections[$key]['class'] = 'hidden'; } } $template_mode = array(array( 'id' => 'template-mode-amp', 'title' => 'Settings', 'icon' => 'el el-cogs', 'priority' => 1, 'fields' => array() ) ); $template_mode = array_merge($template_mode, $seoSection); $sections = array_merge($template_mode, $sections); return $sections; } } function ampforwp_enqueue_template_mode_scripts(){ ?>