Advertisement
Guest User

Tags in Community Events

a guest
Nov 17th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. // This goes to tag.php
  2. <?php
  3.  
  4. if ( !defined('ABSPATH') ) { die('-1'); }
  5.  
  6. $tagi = '';
  7.  
  8. if (isset( $_POST['tags_input'] )) {
  9.     $tagi = esc_attr(strip_tags($_POST['tags_input']));
  10. }
  11. else {
  12.     $a = array();
  13.     $posttags = get_the_tags();
  14.     if ($posttags) {
  15.         foreach($posttags as $tag) {
  16.             $a[]  = $tag->name;
  17.         }
  18.     }
  19.     $tagi = implode(',',$a);
  20. }
  21.  
  22.  
  23. /* html form */
  24.  
  25. ?>
  26.  
  27. <div class="events-community-post-content bubble" id="event_tags">
  28.  
  29.     <label for="post_tags">Tags</label>
  30.  
  31.     <input placeholder="Enter tags" type="text" size="16" name="tags_input" id="post_tags" value="<?php echo $tagi ?>" />
  32.    
  33.     <small class="note">Your comment</small>
  34.    
  35. </div>
  36.  
  37. //This goes to edit-event.php
  38. <?php tribe_get_template_part('community/modules/tag'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement