title: Get current page ID for hook
body: <p>I use a hook from the plugin Formidable Pro (<code>frm_to_email</code>) where I absolutely need to have the ID of the current page (for Advanced Custom Fields). As the code is located in <code>function.php</code>, it seems impossible for me to retrieve it. What can I do to get this value?</p>
  
  <pre><code>function custom_set_email_value($recipients, $values, $form_id, $args){
      global $post;
      $profil_obj = get_field('profil_obj', $post-&gt;ID); // If I put the ID directly (10 for example), it works
  
      if( $form_id == get_field('popup_form_id', 'option') &amp;&amp; $args['email_key'] == get_field('popup_email_id', 'option') ){
          if($profil_obj) {
              foreach( $profil_obj as $post) {
                  setup_postdata($post);
                  $recipients[] = get_field('profil_email', $post-&gt;ID);
              }
          }
          wp_reset_postdata();
      }
      return $recipients;
  }
  add_filter('frm_to_email', 'custom_set_email_value', 10, 4);
  </code></pre>