{"id":17219798,"date":"2023-11-21T21:38:32","date_gmt":"2023-11-21T21:38:32","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/latest-version-broke-code\/"},"modified":"2023-11-21T21:38:32","modified_gmt":"2023-11-21T21:38:32","slug":"latest-version-broke-code","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/latest-version-broke-code\/","title":{"rendered":"Latest version broke code"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I have a snippet that loads at table of amazon links based on a titleid. In a previous version, the following code worked well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"http:\/\/&#091;wbcr_php_snippet id='17166' titleid='8081698']\" target=\"_blank\" rel=\"noopener\"&gt;Paper:&lt;\/a&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This applies to the old code at https:\/\/mountainsangha.org\/products-on-sale. The links to the paper version on amazon are blank (&#8220;https:\/\/&#8221;). This code uses the following snippet, the one referred to above:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>global $alinks;\necho $alinks&#091;$titleid];<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and used to work fine. Now I have to use a new snippet which goes against my sense of &#8220;good coding ethics&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>global $alinks, $alink; $titleid;\n$alink = $alinks&#091;$titleid];\necho \"&lt;a href='https:\/\/\" . $alink . \"' target='_blank'&gt;\";<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Is there something I&#8217;m missing? Why doesn&#8217;t the first code work?<\/p>\n","protected":false},"template":"","class_list":["post-17219798","topic","type-topic","status-publish","hentry","topic-tag-links","topic-tag-url"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17219798","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\/17219798\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17219798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}