Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('wp_insert_post_data', array(&$this, 'filter_wp_insert_post_data'), 10, 2);
- public function filter_wp_insert_post_data( $data, $postarr = array() ){
- if (is_admin()){
- if ($data['post_type'] == 'faq'){
- $data['post_title'] = ($postarr['faq_question'] ? $postarr['faq_question'] : 'Auto Draft');
- }
- }
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement