Advertisement
maxworkingwell

Code for Tom

Jul 21st, 2022
1,186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.28 KB | None | 0 0
  1. 1. Please try this for "Agent slug" (e.g. dave-smith). So replace ‘[wpv-post-author format="url"] with this
  2. [wpv-post-author format="meta" meta="user_nicename"]
  3.  
  4. 2. To set the default value for title try replacing [cred_field field='post_title' class='form-control' output='bootstrap']
  5. on this
  6. [cred_generic_field field="post_title" type="textfield" class="" urlparam=""]
  7. {
  8. "required":0,
  9. "validate_format":0,
  10. persistent:1,
  11. "default":"your first and last name here [wpv-post-author format="meta" meta="user_nicename"]"
  12. }
  13. [/cred_generic_field]
  14.  
  15. Change the "default" parameter as you like.
  16.  
  17. 3. Relationship select fields. As for the "value" parameter, it expects the numeric (id) of the associated post. For example, if you want to connect to a post with id 3, then the shortcode will look like this
  18. [cred_field field='@agent-entry.parent' value='3' class='form-control' output='bootstrap' select_text='— not set —' required='false']
  19.  
  20. It's hard for me to tell what you're trying to link without seeing the site online, but you can try this
  21.  
  22. [cred_field field='@agent-entry.parent' value='[wpv-post-author format="meta" meta="ID"]' class='form-control' output='bootstrap' select_text='— not set -‘required='false']
  23. where [wpv-post-author format="meta" meta="ID"] is the author ID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement