Skip Navigation

[Resolved] Split: How to Edit User profile

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2021927

HI,

Thanks for helping. I have more staff to do.

1. How can user edit thair post ("porfil")?
2. Is their a option to have to see all time form and that form have default value that user are input first time
3. How can I create lithebox gallery? I have create and user can update multiimages, I need creade grid 3x3 and on click opet large image.
4. Link on MY PROFIL PAGE for see/edit post ("profil")?

best regards,
Marko

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-how-to-create-lithebox-gallery/

#2023005

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Marko,

Now, that the form to add a new profile (Projektanti) is ready, the next step is to create a form that can be used to edit the existing profile (Projektanti).

1. Please go to WP Admin -> Toolset -> Post Forms and clone the form "Form for Projektanti".
( screenshot: hidden link )

You can name the new copy of the form something like "Form for editing Projektanti".

2. Next, open the edit screen of the newly created form "Form for editing Projektanti" and change its type from "Add new content" to "Edit existing content".
( screenshot: hidden link )

3. You'll also need a custom shortcode, that can get the current user's existing profile (Projektanti) post ID and used it with the newly created edit form:


add_shortcode('current_user_profile_edit_form', 'current_user_profile_edit_form_fn');
function current_user_profile_edit_form_fn( $atts ) {

	$a = shortcode_atts( array(
		'type' => '',
		'form' => ''
	), $atts );

	$user_post = get_posts( array( 
		'post_type'		=> $a['type'], 
		'author'		=> get_current_user_id(),
		'numberposts'	=> 1
	) );

	if(!empty($user_post)) {
		$target_post = $user_post[0]->ID;
		ob_start();
		echo do_shortcode('[cred_form form="'.$a['form'].'" post="'.$target_post.'"]');
		return ob_get_clean();
	}

}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.

4. Lastly, you'll place, this shortcode inside the conditional check on your "Moj profil" page, just below the existing code for the add a new profile form:
( screenshot: hidden link )


{!{wpv-conditional if="  ( ( '[current_user_post_count type='projektanti']' ne '0' ) ) " }!}
{!{current_user_profile_edit_form type="projektanti" form="form-for-editing-projektanti"}!}
{!{/wpv-conditional}!}

As a result, a user who has not created a profile (Projektanti), will see the form to add a new profile (Projektanti). And the user who has already created a profile (Projektanti), will see the form to edit it.

Note: I'll reply to your question about the lightbox gallery, in a separate ticket.
( ref: https://toolset.com/forums/topic/split-how-to-create-lithebox-gallery/ )

regards,
Waqar

#2025731

Hi,

I copy your code but don't work for me, I canot see form. Login data are the same so pleas can you login and see what is wront.

regards,
Marko

#2025815

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

I see incomplete code added on the "Moj profil" page.
( screenshot: hidden link )

As explained in step #4 in my last message, please add the complete conditional block, in the "Korisnički podaci" tab's content.
( screenshot: hidden link )

#2026537

Hi..I create everything like you say..not work, than I remove some code just for testing and stil not work..now oyu can see I put all code just like you say and stil not working..I analysed code and I don't know what it is mean NE in you code?

Pleas help

best regards,
Marko

#2026713

FOrget to say,I add shortcodes to Third-party shortcode arguments just like I must add for current user post count, but stil user don't see form for edit their post (profil).

best regards,
Marko

#2027323

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

During troubleshooting, I noticed that in the second conditional block, the incorrect post type slug "projektanti" was used:


{!{wpv-conditional if=" ( ( '[current_user_post_count type='projektanti']' ne '0' ) ) " }!}
{!{current_user_profile_edit_form type="projektanti" form="form-for-editing-projektanti"}!}
{!{/wpv-conditional}!}

As the correct post type slug is "projektant", after correction, the edit form is showing correctly now.
( please make sure you are testing with a user who has created a "projektant" post )

#2027547

why you don't create one post with your login and than you will see that it's not working... I have create user markohotmail, created post, post are live, with admin login in dashboard I see that post Marko firma have autor markohotmail..but with markohotmail login in page my profil page I don't see form for editi...

I have deadline and I need this to work, please can you fix this?

#2027819

Hi Waqar,

have update..I somehow manage to set template for editing post ("profil") and on each post I puted link for editing.

I have problem when user registred on site, than login and writed a post, post are public but on frontend there are noting to see (on list od post I see data, or inside dashboard but on frontend nothing).

Can you try reg and login on site and thant fill the form to submit post.

best regards,
Marko

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-how-to-show-single-post-page-content/

#2028555

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

> why you don't create one post with your login and than you will see that it's not working... I have create user markohotmail, created post, post are live, with admin login in dashboard I see that post Marko firma have autor markohotmail..but with markohotmail login in page my profil page I don't see form for editi...

- I'm not sure, why it didn't work for you, but here are the results of my test.

1. I visited the profile page at /moj-profil/ and it was showing the "Form for Projektanti" as my user had no "Projektanti" post.
( screenshot: hidden link )

2. Next, I submitted the form and the "Test company name" post was created successfully, with my user set as the author.
( screenshot: hidden link )

3. After that, I visited the profile page at /moj-profil/ and now it was showing the post edit form "Form for editing Projektanti" with my post "Test company name" set for editing.
( screenshot: hidden link )

I hope this makes it more clear and if you're still seeing different behavior, please share similar screenshots or a short video, showing the issue.

As for your new question about the content shown on the single post pages, I've created a separate ticket for that.
( ref: https://toolset.com/forums/topic/split-how-to-show-single-post-page-content/ )

#2028921

How to put link on my profil page that user can see their post ("profil")?
How can user delete their profil and post ("porfil")?

One question, if I create new ticket that you will answer or someone else? I ask because you are familiar with my project (user have post but that post are user profile...)

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-how-to-add-view-and-delete-profile-link/

#2030551

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back and I've created a new ticket for your new questions.
( ref: https://toolset.com/forums/topic/split-how-to-add-view-and-delete-profile-link/ )

When you create a new ticket and you'd like me to follow up on it, you can include a note in the message that Waqar knows my website. This way other supporters will pass it to me.

You can mark this ticket about editing the user profile as resolved.

#2031129

My issue is resolved now. Thank you!

#2051023

Hi Waqar,

I need one more time help from you. I create new user (Izvodac) and everything the same bum I canot get for for edit post (First form to create post - works) but on my profil page I can get form for editit that post.

Pleas can you inspect?

best regards,
M