
{"id":5939,"date":"2011-09-19T17:58:51","date_gmt":"2011-09-19T17:58:51","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=5939"},"modified":"2011-09-19T17:58:51","modified_gmt":"2011-09-19T17:58:51","slug":"php-2011-september-19","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2011\/09\/19\/php-2011-september-19\/","title":{"rendered":"[ php ]     2011 september  19"},"content":{"rendered":"<h5><u> PHP Code <\/u><\/h5>\n<p><code><br \/>\nif(post_password_required() || (!comments_open() &amp;&amp; is_page() &amp;&amp; $app-&gt;post-&gt;getCommentCount() &lt; 1)) return;<br \/>\n<\/code><br \/>\n<\/p>\n<h5><u> Code Dissection <\/u><\/h5>\n<pre>\n1. if --- Statement . Conditional Statement.\nif statement - use this statement to execute some code only if a specified condition is true\n\n2. post_password_required() --- WordPress API\npost_password_required (line 558)\nWhether post requires password and correct password has been provided.\n\nreturn: false if a password is not required or the correct password cookie is present, true otherwise.\nsince: 2.7.0\nbool post_password_required ([int|object  $post = null])\nint|object $post: An optional post. Global $post used if not provided.\n\n3. || --- Logical Operator. OR operator. PHP operator.\nx=6\ny=3\n(x==5 || y==5) returns false\n\n4. ! --- PHP\/Logical\/NOT operator .\nx=6\ny=3\n!(x==y) returns true\n\n5. comments_open --- WordPress API.\ncomments_open (line 772)\nWhether the current post is open for comments.\n\nreturn: True if the comments are open\nsince: 1.5.0\nuses: $post\nbool comments_open ([int $post_id = NULL])\nint $post_id: An optional post ID to check instead of the current post.\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PHP Code if(post_password_required() || (!comments_open() &amp;&amp; is_page() &amp;&amp; $app-&gt;post-&gt;getCommentCount() &lt; 1)) return; Code Dissection 1. if &#8212; Statement . Conditional Statement. if statement &#8211; use this statement to execute some code only if a specified condition is true 2. post_password_required() &#8212; WordPress API post_password_required (line 558) Whether post requires password and correct password has been &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2011\/09\/19\/php-2011-september-19\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;[ php ]     2011 september  19&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/5939"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=5939"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/5939\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=5939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=5939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=5939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}