| @@ -34,15 +34,15 @@ | ||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function ays_poll_register_custom_post_type(){ |
| 37 | 37 | $args = array( |
| 38 | - 'public' => true, | |
| 39 | - 'rewrite' => true, | |
| 40 | - 'show_in_menu' => false, | |
| 41 | - 'exclude_from_search' => false, | |
| 42 | - 'show_ui' => false, | |
| 43 | - 'show_in_nav_menus' => false, | |
| 44 | - 'show_in_rest' => false | |
| 38 | + 'public' => true, | |
| 39 | + 'rewrite' => true, | |
| 40 | + 'show_in_menu' => false, | |
| 41 | + 'exclude_from_search' => false, | |
| 42 | + 'show_ui' => false, | |
| 43 | + 'show_in_nav_menus' => false, | |
| 44 | + 'show_in_rest' => false | |
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | register_post_type( 'ays-poll-maker', $args ); |
| 48 | 48 | $this->ays_poll_custom_rewrite_rule(); |
| @@ -57,14 +57,14 @@ | ||
| 57 | 57 | |
| 58 | 58 | $post_content = '[ays_poll id="'.$poll_id.'"]'; |
| 59 | 59 | |
| 60 | 60 | $new_post = array( |
| 61 | - 'post_title' => $poll_title, | |
| 62 | - 'post_author' => $author_id, | |
| 63 | - 'post_type' => 'ays-poll-maker', // Custom post type name is -> ays-poll-maker | |
| 64 | - 'post_content' => $post_content, | |
| 65 | - 'post_status' => 'draft', | |
| 66 | - 'post_date' => current_time( 'mysql' ), | |
| 61 | + 'post_title' => $poll_title, | |
| 62 | + 'post_author' => $author_id, | |
| 63 | + 'post_type' => 'ays-poll-maker', // Custom post type name is -> ays-poll-maker | |
| 64 | + 'post_content' => $post_content, | |
| 65 | + 'post_status' => 'draft', | |
| 66 | + 'post_date' => current_time( 'mysql' ), | |
| 67 | 67 | ); |
| 68 | 68 | $post_id = wp_insert_post($new_post); |
| 69 | 69 | if($update){ |
| 70 | 70 | if(isset($post_id) && $post_id > 0){ |