GLOBAL Array gets deleted... - WP All Import function.php - -


at moment i'm writing on additional code functions editor wp import plugin. additional code supposed move datas... nothing special...

anyway. problem is, $globals["productsxml"] array gets flushed every time wp import loading new function.

here code:

add_action('pmxi_before_xml_import', 'wp_all_import_before_xml_import', 10, 1); add_action('pmxi_saved_post', 'my_saved_post', 10, 2);  $globals["productsxml"] = array();  function wp_all_import_before_xml_import($import_id){ ... } function my_saved_post($pid, $xml_node){ ... } 

as can see, add functions , i'm initializing $globals["productsxml"] array. plugin works this:

  • call wp_all_import_before_xml_import function @ beginn of entire import. (here load values in $globals["productsxml"] array)
  • call my_saved_post function every time post gets saved (here want access on $globals["productsxml"] array -> empty...)

does knows, why array gets flushed if plugin calling function? - mean, initialized array global, because need transfer values!!!

how can change again. created log. here can see, array loaded in wp_all_import_before_xml_import function in my_saved_post function got flushed...

i not have possibility flush array self because print array log @ beginning of function... must flushed script/plugin itself...

does knows why array gets flushed , how can prevent that?

update: created test , must script... add globals array , gets flushed in next called function... why??? - how can prevent that?

enter image description here

greetings , thank you!


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -