Skip to content

Instantly share code, notes, and snippets.

@hasanTheBest
Created February 14, 2019 01:21

Revisions

  1. hasanTheBest created this gist Feb 14, 2019.
    4 changes: 4 additions & 0 deletions wp_edit_mode_post_id.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    $post_id = 0;
    if ( isset( $_REQUEST['post'] ) || isset( $_REQUEST['post_ID'] ) ) {
    $post_id = empty( $_REQUEST['post_ID'] ) ? $_REQUEST['post'] : $_REQUEST['post_ID'];
    }