User Meta as default value and limit post creation
Author | Posts |
---|---|
June 27, 2013 at 11:57 am 5317 | |
joshi | Hi, I'd like to have a users display name as the default value of a post-title field in a custom post type and to have the post-title field hidden on the WP User Frontend form used to create the post. So basically, when a user creates a post of this post type the title is automatically filled with their display name. I was also wondering if it was possible to limit the number of post creations to 1. Cheers Mark |
June 27, 2013 at 2:01 pm 5321 | |
Tareq Hasan | This php snippet will allow to post only who has less than 1 post. [php] return ‘no’; add_filter( ‘wpuf_can_post’, ‘wpufe_limit_post_one’ ); And this one will set the post title as the display name. wp_update_user(array( add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_set_disply_name’ ); Insert them to your themes functions.php and should work. |
June 27, 2013 at 2:08 pm 5324 | |
MarkGray | Thanks Tareq for your speedy response. I will try these out. |
August 8, 2014 at 8:34 pm 24810 | |
Denis | hello,
cheers, |
February 5, 2015 at 8:56 pm 35890 | |
joshi | Hello, As my previous poster, I also wanted to know how to limit a custom post type. Thank you. |