Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('save_post', 'createGallery');
- function createGallery () {
- global $post;
- if ( $post->post_type == 'activity' ) {
- $gallerypost = array(
- 'post_content' => 'the text of the post',
- 'post_status' => 'publish',
- 'post_title' => 'Photo album',
- 'post_type' => 'post',
- 'post_author' => 1);
- wp_insert_post( $gallerypost );
- }
- }
- do_action('save_post', $post_ID, $post);
- add_action('save_post', 'createGallery',1,1);
- function createGallery ($post_ID) {
- if ( get_post_type($post_ID) == 'activity' ) {
- $gallerypost = array(
- 'post_content' => 'the text of the post',
- 'post_status' => 'publish',
- 'post_title' => 'Photo album',
- 'post_type' => 'post',
- 'post_author' => 1);
- wp_insert_post( $gallerypost );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement