Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * action for when a post is saved publish_post*/
- add_action( 'draft_to_publish', 'savePostMBC', 10, 1 );
- function savePostMBC($post) {
- error_log('draft to publish');
- error_log('post id: '.$post->ID);
- add_post_meta( $post->ID, '_created', 'true', true );
- //error_log('post id: '.$post_id);
- //$feeds = get_fields($post_id); //get_field('feeds', $post_id); // way to get the
- //error_log('feed:');
- //error_log(print_r($feeds,true));
- }
- /* action for when a post is updated */
- add_action( 'edit_post', 'updatePostMBC', 10, 2 );
- //add_action( 'publish_post', 'updatePostMBC', 10, 2 );
- function updatePostMBC($post_id, $post) {
- error_log('updating post');
- // always runs
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement