Advertisement
johncarlson21

Untitled

Oct 19th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. * action for when a post is saved publish_post*/
  2. add_action( 'draft_to_publish', 'savePostMBC', 10, 1 );
  3.  
  4. function savePostMBC($post) {
  5.     error_log('draft to publish');
  6.     error_log('post id: '.$post->ID);
  7.     add_post_meta( $post->ID, '_created', 'true', true );
  8.     //error_log('post id: '.$post_id);
  9.     //$feeds = get_fields($post_id); //get_field('feeds', $post_id); // way to get the
  10.    
  11.     //error_log('feed:');
  12.     //error_log(print_r($feeds,true));
  13.    
  14. }
  15.  
  16. /* action for when a post is updated */
  17. add_action( 'edit_post', 'updatePostMBC', 10, 2 );
  18. //add_action( 'publish_post', 'updatePostMBC', 10, 2 );
  19.  
  20. function updatePostMBC($post_id, $post) {
  21.     error_log('updating post');
  22. // always runs
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement