{"id":11328481,"date":"2019-03-19T03:44:20","date_gmt":"2019-03-19T03:44:20","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/toggle-issue-2\/"},"modified":"2019-03-19T03:44:20","modified_gmt":"2019-03-19T03:44:20","slug":"toggle-issue-2","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/toggle-issue-2\/","title":{"rendered":"Toggle issue"},"content":{"rendered":"<p>I&#8217;m trying to add a switch that tells if a text field is a link or not then using the code in the block like below.  It works fine except it outputs plain text of the two fields as well as the html in the echo.  I&#8217;m not sure what i&#8217;m doing wrong?<\/p>\n<pre><code>\n&lt;div&gt;&lt;?php block_field( &#039;number&#039; ) ?&gt;&lt;\/div&gt;\n&lt;?php\nif ( block_value( &#039;title-link&#039; ) ) {\n\techo &quot;&lt;a href=&#039;#&#039;&gt;&quot; . block_field( &#039;title&#039; ) . &quot;&lt;\/a&gt;&quot;;\n}else {\n    echo &quot;&lt;div&gt;&quot; . block_field( &#039;title&#039; ) . &quot;&lt;\/div&gt;&quot; ;\n}\n?&gt; <\/code><\/pre>\n","protected":false},"template":"","class_list":["post-11328481","topic","type-topic","status-publish","hentry","topic-tag-toggle"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11328481","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\/11328481\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11328481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}