SHARE
TWEET

Untitled

a guest Dec 4th, 2013 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function render_posttitle( $form_id, $post_id, $form_settings ) {
  2.     $value = get_post_meta( $post_id, 'post_title', true );  
  3.     update_post_meta( $post_id, 'meta_posttitle', $value );
  4.     ?>
  5.     <div class="wpuf-fields">
  6.         <input type="hidden" name="my_posttitle" value="<?php echo esc_attr( $value ); ?>">
  7.     </div>
  8.     <?php
  9. }
  10. add_action( 'hook_render_posttitle', 'render_posttitle', 10, 3 );
  11.  
  12. /* Write meta key */
  13. function get_posttitle( $post_id ) {
  14.     if ( isset( $_POST['my_posttitle'] ) ) {
  15.         update_post_meta( $post_id, 'meta_posttitle', $_POST['my_posttitle'] );
  16.     }
  17. }
  18.          
  19. add_action( 'wpuf_add_post_after_insert', 'get_posttitle' );
  20. add_action( 'wpuf_edit_post_after_update', 'get_posttitle' );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top