{"id":11170557,"date":"2019-02-05T12:13:33","date_gmt":"2019-02-05T12:13:33","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/shared-variables\/"},"modified":"2019-02-05T12:13:33","modified_gmt":"2019-02-05T12:13:33","slug":"shared-variables","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/shared-variables\/","title":{"rendered":"Shared variables"},"content":{"rendered":"<p>Hello Alex,<br \/>\nVery nice plugin, simple and does the job well.<\/p>\n<p>When having multiples php instances that share same variable, i noticed that I have to include same variable in each instance, so basically when updating variables, I would have to do it in all instances every time.<\/p>\n<p>Is there a way to have one instance where I update the variable and then it shares it across all instances that are posted on same page?<\/p>\n<p>Example:<br \/>\n&lt;?php<br \/>\n\/\/master update here<br \/>\nif($instance==&#8221;1&#8243;)<br \/>\n{<br \/>\n$date1=&#8221;2018-08-01&#8243;;<br \/>\n$date2=&#8221;2017-11-01&#8243;;<br \/>\n}<br \/>\nif($instance==&#8221;2&#8243;)<br \/>\n{<br \/>\necho $date1;<br \/>\n}<br \/>\nif($instance==&#8221;3&#8243;)<br \/>\n{<br \/>\necho $date2;<br \/>\n}<\/p>\n<p>?&gt;<br \/>\nMany thanks.<\/p>\n<p>Naim<\/p>\n","protected":false},"template":"","class_list":["post-11170557","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11170557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11170557\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11170557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}