0, 'post_status' => 'publish', 'post_author' => 0, 'post_parent' => 0, 'post_type' => 'page', 'post_date' => 0, 'post_date_gmt' => 0, 'post_modified' => 0, 'post_modified_gmt' => 0, 'post_content' => '', 'post_title' => '', 'post_excerpt' => '', 'post_content_filtered' => '', 'post_mime_type' => '', 'post_password' => '', 'post_name' => '', 'guid' => '', 'menu_order' => 0, 'pinged' => '', 'to_ping' => '', 'ping_status' => '', 'comment_status' => 'closed', 'comment_count' => 0, 'filter' => 'raw', ),$args); } public function apply_prefix($options = array()){ global $skelet_path; $arr_options = array(); foreach ($options as $option) { $arr_option = array(); foreach ($option as $key => $value) { $new_prefix = ""; if($key == "name" || $key == "id"){ $new_prefix = $skelet_path["prefix"].'_'.$value; }elseif($key == "settings" || $key == "fields" || $key == "sections" || $key == "shortcodes"){ $arr_settings = array(); foreach ($value as $key_settings => $val_settings) { $arr_sets = array(); foreach($val_settings as $vkey => $vval){ if($vkey == "fields"){ $arr_vvfields = array(); foreach ($vval as $vvkey => $vvval) { if(isset($vvval["id"])){ $vvval["id"] = $skelet_path["prefix"].'_'.$vvval["id"]; } array_push($arr_vvfields,$vvval); } $arr_sets[$vkey] = $arr_vvfields; }else if($vkey == "name" || $vkey == "id"){ $arr_sets[$vkey] = $skelet_path["prefix"].'_'.$vval; }else{ $arr_sets[$vkey] = $vval; } } array_push($arr_settings,$arr_sets); } if(!empty($arr_settings)){ $new_prefix = $arr_settings; } }else{ $new_prefix = $value; } $arr_option[$key] = $new_prefix; } array_push($arr_options, $arr_option); } return $arr_options; } } }