Guest User

Untitled

a guest
Jan 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. function presentation($post_id){
  2. if($post_id){
  3. $presentation = new Presentation($post_id); // to populate
  4. }else{
  5. $presentation = current_presentation(); // switch to create
  6. }
  7.  
  8. function current_presentation(){
  9. if( xxx_type_is_xxx_page() ){
  10. return new Presentation();
  11. }elseif( yyy_type_is_yyy_page() ){
  12. return new Presentation();
  13. }elseif(){
  14. //and so on...
  15. }else{
  16. return false; // do not create if not on the above post type creation page
  17. }
  18. }
Add Comment
Please, Sign In to add comment