|
Associate CPTs with author
Started by: martinC-3
in: Toolset Professional Support
|
|
2 |
15 |
6 years, 11 months ago
martinC-3
|
|
Table of users and CPTs
Started by: Kostas
in: Toolset Professional Support
|
|
2 |
18 |
6 years, 11 months ago
Kostas
|
|
Can Toolset do this?
Started by: Tiago Valente
in: Toolset Professional Support
|
|
2 |
4 |
6 years, 11 months ago
Luo Yang
|
|
help to find missing relationship submenu button from menu toolset
Started by: rexJ-2
in: Toolset Professional Support
|
|
2 |
3 |
6 years, 11 months ago
rexJ-2
|
|
adding/connecting data to user account
Started by: malagaS
in: Toolset Professional Support
|
|
2 |
7 |
6 years, 11 months ago
malagaS
|
|
Setting up a site about topics with Toolset
Started by: Vane
in: Toolset Professional Support
|
|
2 |
4 |
6 years, 11 months ago
Christian Cox
|
|
create-templates-for-custom-post-types-with-divi-builder-and-toolset
Started by: TammyD4083
in: Toolset Professional Support
|
|
2 |
3 |
6 years, 11 months ago
Nigel
|
|
Write parent post title as value in custom field of child post on save
Started by: philipG-3
in: Toolset Professional Support
|
|
2 |
6 |
6 years, 11 months ago
philipG-3
|
|
Automatically create a custom post during User registration with CRED and restrict access
Started by: davidL-10
in: Toolset Professional Support
Quick solution available
Problem: I have a new User CRED form that allows guests to register. When they submit the form, I would like to automatically create a custom post that includes information from the form, and I would like to restrict access to that post to the created member only.
Solution:
1. Create a Custom Post Entry for "Band Name" on Member Registration.
This can be accomplished with a bit of custom code using the cred_save_data API.
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data)
{
if ($form_data['id']==1234)
{
$my_post = array(
'post_title' => $_POST['some_custom_input'],
'post_status' => 'publish',
'post_author' => $post_id,
'post_type' => 'band-post-type-slug'
);
// Insert the post into the database
wp_insert_post( $my_post );
}
}
1234 should be changed to match the numeric ID of your User CRED form, and 'some_custom_input' should be changed to match the name of an input containing the data you would like to use in the Band post title. The data in the $my_post array can be modified according to the wp_insert_post documentation.
2. Only allow the registered Member edit his own Band Page.
In the code I provided above, I have configured the new post's author to be automatically set to the User that was just created during registration. Once this registration form is up and running, you should be able to use Access post and form restrictions based on the post Author (Member can edit own vs Member can edit any).
Relevant Documentation:
https://developer.wordpress.org/reference/functions/wp_insert_post/
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://toolset.com/documentation/user-guides/setting-access-control/
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
https://toolset.com/documentation/user-guides/access-control-for-cred-forms/
|
|
2 |
6 |
6 years, 12 months ago
Christian Cox
|
|
How to show Post Title
Started by: charlie
in: Toolset Professional Support
|
|
2 |
6 |
6 years, 12 months ago
charlie
|
|
Cred Form associating with CPT
Started by: davidL-10
in: Toolset Professional Support
Quick solution available
|
|
2 |
8 |
6 years, 12 months ago
davidL-10
|
|
Conditional – check if specific child posts do not exist
Started by: Matthias Reichl
in: Toolset Professional Support
|
|
2 |
5 |
7 years ago
Matthias Reichl
|
|
get published date of post used in post relationship
Started by: marcB-6
in: Toolset Professional Support
Quick solution available
|
|
2 |
5 |
7 years ago
marcB-6
|
|
Users setting many to many relationships
Started by: collinC-2
in: Toolset Professional Support
|
|
2 |
2 |
7 years ago
Christian Cox
|
|
Creating a relationship with existing data to be reused across multiple posts
Started by: fredB-4
in: Toolset Professional Support
Quick solution available
Problem: I would like to set up Properties (a CPT) so that they can be associated with Amenities. What is the best way to do this so the Amenities can be reused across multiple Properties?
Solution: Use a custom field on your Properties custom post type that allows your users to select multiple Amenities using checkboxes. The same checkboxes will be available on all Property posts, so you can reuse the same options but make different selections. Use unique numeric values for each option, and save "0" when nothing is checked.
To display the selected Amenities on a Property post on the front-end, use conditionals to determine whether an option was checked:
[wpv-conditional if="( $(wpcf-amenities-list) eq '1' )"]
Garage
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-amenities-list) eq '2' )"]
BBQ
[/wpv-conditional]
Relevant Documentation: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
|
|
2 |
5 |
7 years ago
fredB-4
|