plechev

пример удаления дефолтных полей формы публикации

Apr 20th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. add_filter('rcl_default_public_form_fields','notes_remove_publicform_fields',10,2);
  2. function notes_remove_publicform_fields($fields, $post_type){
  3.    
  4.     if($post_type != 'notes') return $fields;
  5.    
  6.     $remove = array(
  7.         'post_title',
  8.         'post_excerpt',
  9.         'post_uploader'
  10.     );
  11.    
  12.     foreach($fields as $k => $field){
  13.        
  14.         if(in_array($field['slug'], $remove)){
  15.             unset($fields[$k]);
  16.         }
  17.        
  18.     }
  19.    
  20.     return $fields;
  21.    
  22. }
Add Comment
Please, Sign In to add comment