Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function render_posttitle( $form_id, $post_id, $form_settings ) {
- $value = get_post_meta( $post_id, 'post_title', true );
- update_post_meta( $post_id, 'meta_posttitle', $value );
- ?>
- <div class="wpuf-fields">
- <input type="hidden" name="my_posttitle" value="<?php echo esc_attr( $value ); ?>">
- </div>
- <?php
- }
- add_action( 'hook_render_posttitle', 'render_posttitle', 10, 3 );
- /* Write meta key */
- function get_posttitle( $post_id ) {
- if ( isset( $_POST['my_posttitle'] ) ) {
- update_post_meta( $post_id, 'meta_posttitle', $_POST['my_posttitle'] );
- }
- }
- add_action( 'wpuf_add_post_after_insert', 'get_posttitle' );
- add_action( 'wpuf_edit_post_after_update', 'get_posttitle' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement