Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.27 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. get the post id in wordpress plugin
  2. global $post;
  3. $current_page_id = $post->ID;
  4. var_dump($current_page_id);
  5.        
  6. add_action('wp_footer', 'test');
  7. function test(){
  8. global $post;
  9. $current_page_id=$post->ID;
  10. }
  11.        
  12. my_function($base_url, array('variable_to_post'=>$post->ID));