Advertisement
BakerMan

Community Events: remove description field

Oct 24th, 2012
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. function allowEmptyPostContent() {
  2.     return false;
  3. }
  4.  
  5. function removeDescriptionRequirement() {
  6.     // Only proceed if the form has been submitted
  7.     if (empty($_POST)) return;
  8.    
  9.     // post_content is checked to ascertain if it is empty or not - we'll
  10.     // workaround this by filling the relevant posted fields with whitespace
  11.     $_POST['post_content'] = ' ';
  12.     $_POST['tcepostcontent'] = ' ';
  13.    
  14.     // Temporarily allow empty post content
  15.     add_filter('wp_insert_post_empty_content', 'allowEmptyPostContent');
  16. }
  17.  
  18. // Lets remove the requirement for the Community/Add description field
  19. add_action('tribe_ce_before_event_submission_page', 'removeDescriptionRequirement');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement