{"id":5397,"date":"2026-04-30T10:01:45","date_gmt":"2026-04-30T09:01:45","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=5397"},"modified":"2026-04-30T10:01:45","modified_gmt":"2026-04-30T09:01:45","slug":"reload-page-to-clear-post","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/page-control\/reload-page-to-clear-post","title":{"rendered":"Reload page to clear post"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Also scroll to anchor ID<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">In your page code<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  \/\/----- GET OTHER URL ARGUMENTS -----\n  $ScrollPageToAnchorId = $_GET&#91;'scroll_to_anchor'] ?? '';\n\n  if ($ScrollPageToAnchorId !== '')\n  {\n    \/\/SCROLL PAGE TO ANCHOR\n    $HtmlOutput .= &lt;&lt;&lt;_END\n      &lt;script>\n        document.addEventListener(\"DOMContentLoaded\", function(event) {\n          document.getElementById('$ScrollPageToAnchorId').scrollIntoView(true);\n        });\n      &lt;\/script>\n_END;\n  }<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">To trigger it<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  \/\/Redirect to same page to clear POST\n  $RedirectToUrl = parse_url($_SERVER&#91;\"REQUEST_URI\"], PHP_URL_PATH);    \/\/Get page without any url arguments\n  $RedirectToUrl .= \"?gid=$GroupId\";\n  $RedirectToUrl .= \"&amp;scroll_to_anchor=MyAnchorIdName\";\n  echo '&lt;script>window.location.replace(\"' . $RedirectToUrl . '\");&lt;\/script>';\n  return '';<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Also scroll to anchor ID In your page code To trigger it<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[346,42,20],"tags":[],"class_list":["post-5397","post","type-post","status-publish","format-standard","hentry","category-forms-wordpress","category-forms","category-page-control"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=5397"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5397\/revisions"}],"predecessor-version":[{"id":5398,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5397\/revisions\/5398"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=5397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=5397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=5397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}