I am receiving a var from a php page like:
$myId = sanitize_key( $_POST['varPostId'] ); $myId = (int) $myId; That sets a query:
query_posts(array( 'post__in' => array($myId) )); Thing is this is an edit page, which means I will be able to change some input data on the page, but when I click the update button the page looses $myId and the query won't work, which means I get an empty page.
I thought to save the id in localStorage but I still didn't get the right logic nor I know if it's the best way. So I am looking into a php or a js solution.