Advertisement
Guest User

Untitled

a guest
Dec 4th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  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' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement