{"id":37,"date":"2021-08-15T09:02:43","date_gmt":"2021-08-15T09:02:43","guid":{"rendered":"https:\/\/demo.daext.com\/restricted-blocks\/?p=37"},"modified":"2023-10-11T14:03:07","modified_gmt":"2023-10-11T14:03:07","slug":"restrictions-based-on-the-http-headers","status":"publish","type":"post","link":"https:\/\/demo.daext.com\/restricted-blocks\/restrictions-based-on-the-http-headers\/","title":{"rendered":"Restrictions based on the HTTP Headers"},"content":{"rendered":"\n<p>With this restriction, you can display or hide content based on the information available in the HTTP headers.<\/p>\n\n\n\n<p>Please note that the plugin allows you to either display additional information on the restriction (as we did in this demo page) or completely remove the block from the layout.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example 1<\/h4>\n\n\n\n<p>The following block is available with the HTTP requests that have one the following values in the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/User-Agent\">User-Agent<\/a> request header:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>bot<\/li><li>crawl<\/li><li>spider<\/li><li>Yandex<\/li><\/ul>\n\n\n<div class=\"daextreblp-restricted-block-container\">\n\t\t\t\t\t\t\t<img class=\"daextreblp-restricted-block-icon\"\n\t\t\t\t\tsrc=\"https:\/\/demo.daext.com\/restricted-blocks\/wp-content\/plugins\/restricted-blocks-pro\/shared\/assets\/img\/padlock.png\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"daextreblp-restricted-block-title\">Restricted Content<\/div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"daextreblp-restricted-block-description\">Sorry, this content isn&#039;t available right now.<\/div>\n\t\t\t\n\t\t\t<\/div>\n\n\n<h4 class=\"wp-block-heading\">Example  2<\/h4>\n\n\n\n<p><meta http-equiv=\"content-type\" content=\"text\/html; charset=utf-8\">The following block is available with the HTTP requests that have one the following values in the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Referer\">Referer<\/a> request header:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>https:\/\/google.com\/<\/li><li>https:\/\/twitter.com\/<\/li><\/ul>\n\n\n<div class=\"daextreblp-restricted-block-container\">\n\t\t\t\t\t\t\t<img class=\"daextreblp-restricted-block-icon\"\n\t\t\t\t\tsrc=\"https:\/\/demo.daext.com\/restricted-blocks\/wp-content\/plugins\/restricted-blocks-pro\/shared\/assets\/img\/padlock.png\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"daextreblp-restricted-block-title\">Restricted Content<\/div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"daextreblp-restricted-block-description\">Sorry, this content isn&#039;t available right now.<\/div>\n\t\t\t\n\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>With this restriction, you can display or hide content based on the information available in the HTTP headers. Please note that the plugin allows you to either display additional information on the restriction (as we did in this demo page) or completely remove the block from the layout. Example 1 The following block is available [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-demo"],"_links":{"self":[{"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":1,"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/posts\/37\/revisions\/171"}],"wp:attachment":[{"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demo.daext.com\/restricted-blocks\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}