Special CRED shortcodes that control the basic functionality of every form:

[credform class='cred-form cred-keep-original'][/credform] – mandatory, renders the form
[cred_field field='form_messages' value=''] – optional, renders the message containers
[cred_field field='form_submit' value='Submit' urlparam=] – mandatory, renders the submit button

Removing the mandatory shortcodes from your forms will cause them to break.

cred_generic_field Render a form generic field (general fields not associated with Toolset Types plugin)
cred_field Render a form field (using fields defined in Toolset Types plugin and / or Taxonomies)
cred_delete_post_link Display a link to delete a post
cred_link_form Display a link to edit a post with given form
cred_child_link_form Display a link to a page to add a child post
cred_link_user_form Display a link to edit a user with given form
cred_form Display a CRED form
cred_user_form Display a CRED user form

cred_generic_field

Description: Render a form generic field (general fields not associated with Toolset Types plugin)
Parameters: ‘field’ => Field name (name like used in html forms)
‘type’ => Type of input field (eg checkbox, email, select, radio, checkboxes, date, file, image etc..)
‘class’=> [optional] CSS class to apply to the element

Inside shortcode body the necessary options and default values are defined as JSON string (autogenerated by GUI). Please note that if the value of Generic Field is to be saved in the Database, “persist” option must be set to “1”.

Example usage: [cred_generic_field field="gmail" type="email" class=""]
{
"required":0,
"validate_format":0,
"persist":0,
"default":""
}
[/cred_generic_field]

cred_field

Description: Render a form field (using fields defined in Toolset Types plugin and / or Taxonomies)
Parameters: ‘field’ => Field slug name
‘post’ => [optional] Post Type where this field is defined
‘value’=> [optional] Preset value (translated automatically if WPML translation exists)
‘taxonomy’=> [optional] Used by taxonomy auxiliary fields (eg. “show_popular”) to signify to which taxonomy this field belongs (used with “type” option)
‘type’=> [optional] Used by taxonomy auxiliary fields (like show_popular) to signify which type of functionality it provides (eg. “show_popular”) (used with “taxonomy” option)
‘display’=> [optional] Used by fields for Hierarchical Taxonomies (like Categories) to signify the mode of display (ie. “select” or “checkbox”)
‘single_select’=> [optional] ‘true’ | ‘false’ (default) – If the display=’select’ argument is set, then single_select=’true’ will only allow a single option to be selected (by default multiple options can be selected)
‘readonly’=> [optional] ‘true’ | ‘false’ (default) – When set to ‘true’, the field will be read only.
‘placeholder’=> [optional] This value is being displayed when the field is empty.
Example usage: Render the Types field “Mobile” defined for post type Agent
[cred_field field="mobile" post="agent" value="555-1234"]

cred_delete_post_link

Description: Display a link to delete a post
Parameters: ‘post’=> [optional] Post ID of post to delete (if post is omitted then current post_id will be used, for example inside Loop)
‘text’=> [optional] Text to use for link (can use meta-variables like %TITLE% and %ID%)
‘action’=> either ‘trash’ (sent post to Trash) or ‘delete’ (completely delete post)
‘class’=> [optional] CSS class to apply to link
‘style’=> [optional] CSS style to apply to link
‘message’=> [optional] Confirmation message before deleting post
‘message_after’=>[optional] Confirmation message after deleting post
‘message_show’=>[optional] either ‘1’ (show confirmation message before deleting) or ‘0’ (not show confirmation message before deleting)
‘redirect’=> [optional] Integer value. If set to 0, then the user will not being redirected. Otherwise, after confirming the deletion, the user will be redirected to the page with an ID equal to ‘redirect’.
Example usage: Display link for deleting car custom post with ID 145:
[cred_delete_post_link post="145" text="Delete this car" action="delete"]
Example usage: You can also use this function in PHP in your templates and themes. It has the same functionality as the shortcode. Please note that you have to echo this function for it to work. Additionally, the order of arguments in the function is important and should be as presented in the following example:

cred_delete_post_link($post_id, $text, $action,
$class, $style, $message, $message_after, $message_show, $redirect);

If you want to omit any of these arguments, simply replace it with two single-quotes, for example:

cred_delete_post_link($post_id, $text, $action, '', '', '', '', '', $redirect);

Full, working example of this function in your site, would look like this:

echo cred_delete_post_link(get_the_ID(), 'Delete this post',
'delete', 'cred-refresh-after-delete my-custom-css-class', 'display: block;', 
'Do you really want to delete this post?', 'Post Deleted.', 1, 1);

Please note: for redirection to work, you must include the cred-refresh-after-delete class besides your own custom ones.

Please note: after post is deleted, an alert pop-up will appear asking users if they want to be taken to the home page. Clicking OK will take users to the home page and clicking Cancel will redirect them to the URL you specify in your functions.php file (see next example).

Please note: if $post_id argument is empty, null or false, the system will try to get the value from the global $post. If this value is empty too, function will return a message about it.

Example usage: Change the URL that users will be redirected to after deleting a form. In this example users will be redirected to mydomain.com/client/ page, where mydomain.com is the domain of the site in question. This code should be placed into a site’s theme functions.php file.

add_filter("cred_redirect_after_delete_action", "test");
function test($redurl, $post_id) { 
return "/client/"; 
}

cred_link_form

Description: Display a link to edit a post with given form
Parameters: ‘form’ => Form Title or Form ID of form to use.
‘post’ => [optional] Post ID of post to edit with this form (if post is omitted then current post_id will be used, for example inside Loop)
‘text’=> [optional] Text to use for link (can use meta-variables like %TITLE% and %ID%)
‘class’=> [optional] CSS class to apply to link
‘style’=> [optional] CSS style to apply to link
‘target’=> [optional] open link in the specific target (_blank,_self,_top)
‘attributes’=> [optional] additional HTML attrubutes (e.g. onclick)
Example usage: Display link for editing car custom post with ID 145 (use form with title “Edit Car”)
[cred_link_form form="Edit Car" post="145" text="Edit this car"]
There is also PHP code to use in templates and themes that has the same functionality as the shortcode

cred_edit_post_link($form, $post_id, $text, $class, $style, $target, $attributes);

cred_child_link_form

Description: Display a link to a page to add a child post
Parameters: ‘form’ => Form Title or Form ID of form to use
‘parent_id’ => Parent of the child post (use “-1” to set the parent according to the currently displayed content)
‘text’=> [optional] Text to use for link
‘class’=> [optional] CSS class to apply to link
‘style’=> [optional] CSS style to apply to link
‘target’=> [optional] open link in the specific target (_blank,_self,_top)
‘attributes’=> [optional] additional HTML attrubutes (e.g. onclick)
Example usage: Display link for adding a child in form page 404 (use form with title “Create child”)
[cred_child_link_form form="404" parent_id="-1" text="Create child" target="_self"]

cred_link_user_form

Description: Display a link to edit a user with given form
Parameters: ‘form’ => Form Title or Form ID of form to use.
‘user’ => [optional] User ID of user to edit with this form. If user parameter is omitted, the current logged in user will be used.
‘text’=> [optional] Text to use for link (can use meta-variables like %TITLE% and %ID%)
‘class’=> [optional] CSS class to apply to link
‘style’=> [optional] CSS style to apply to link
‘target’=> [optional] open link in the specific target (_blank,_self,_top)
‘attributes’=> [optional] additional HTML attrubutes (e.g. onclick)
Example usage: Display link for editing user with ID 12 (use form with title “Edit User”)
[cred_link_user_form form="Edit User" user="12" text="Edit user"]
Display link for editing current logged in user (use form with title “Edit User”)
[cred_link_user_form form="Edit User" text="Edit user"]
There is also PHP code to use in templates and themes that has the same functionality as the shortcode

cred_edit_user_link($form, $user_id, $text, $class, $style, $target, $attributes);

cred_form

Description: Display a CRED form
Parameters: ‘form’ => Slug of the form’s title (for example “my-custom-form”) or ID of the form to display.
‘name’ => Exact name of the form to display, for example “My Custom Form”.
‘post’ => [optional] Post ID of post to edit with this form (if form is an edit form, if post is omitted and form is an edit form, then current post_id will be used, for example inside Loop)
Example usage: Display form for editing car custom post with ID 145 (use form with title “Edit Car”)
[cred_form form="Edit Car" post="145"]
Display form to create a car post (use form with title “Create Car”)
[cred_form form="Create Car"]
Display form with ID 120
[cred_form form="120"]
There is also PHP code to use in templates and themes that has the same functionality as the shortcode

cred_form($form_id,$post_id);

cred_user_form

Description: Display a CRED user form
Parameters: ‘form’ => Form Title or Form ID of form to display.
‘user’ => [optional] User ID of user to edit with this form. If user parameter is omitted, the current logged in user will be used.
Example usage: Display form for editing user with ID 23 (use form with title “Edit User”)
[cred_user_form form="Edit User" user="23"]
Display form for editing current logged in user (use form with title “Edit User”)
[cred_user_form form="Edit User"]
Display form to create a user (use form with title “Create User”)
[cred_user_form form="Create User"]
Display form with ID 50
[cred_user_form form="50"]
There is also PHP code to use in templates and themes that has the same functionality as the shortcode

cred_user_form($form_id,$user_id);