Advertisement
Guest User

Untitled

a guest
Jan 5th, 2011
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. function press_it() {
  2. // define some basic variables
  3. $quick['post_status'] = 'draft'; // set as draft first
  4. $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
  5. $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
  6. $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' ';
  7. $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : '';
  8. $linked_list_url = $_REQUEST['linked_list_url'];
  9.  
  10.  
  11. // set the post_content and status
  12. $quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft';
  13. $quick['post_content'] = $content;
  14. // error handling for media_sideload
  15. if ( is_wp_error($upload) ) {
  16. wp_delete_post($post_ID);
  17. wp_die($upload);
  18. } else {
  19. $quick['ID'] = $post_ID;
  20. wp_update_post($quick);
  21. add_post_meta($post_ID, 'linked_list_url', $linked_list_url, false);
  22.  
  23. }
  24.  
  25. <div id="quicktags"></div>
  26. <div class="editor-container">
  27. <textarea name="content" id="content" style="width:100%;" class="theEditor" rows="15"><?php
  28. if ( $selection )
  29. echo wp_richedit_pre($selection);
  30. if ( $url ) {
  31. echo '<p>';
  32. if ( $selection )
  33. _e('via ');
  34. printf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
  35. }
  36. ?></textarea>
  37. <h3>My Link URL</h3>
  38.  
  39. <input name="linked_list_url" type="text" id="elink" class="mceEditor" style="width:100%;" value="<?php echo $url; ?>"/>
  40.  
  41. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement