Posted By

larscmagnusson on 07/18/13


Tagged

wordpress wp Parent subpage parent-post post-parent


Versions (?)

Get given or global post


 / Published in: PHP
 

  1.  
  2. // Hämtar den globala posten eller angiven.
  3. function get_given_or_global_post($post_id){
  4. global $post;
  5.  
  6. if(is_null($post_id) || $post_id == 0)
  7. return $post;
  8. else
  9. return get_post($post_id);
  10.  
  11. }
  12.  

Report this snippet  

You need to login to post a comment.