Navigation überspringen

[Gelöst] member edit listing

This support ticket is created vor 4 Jahre, 6 Monaten. There's a good chance that you are reading advice that it now obsolete.

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 6 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von staceyz vor 4 Jahre, 6 Monaten.

Assistiert von: Minesh.

Author
Artikel
#1912675
Screen Shot 2021-01-20 at 5.22.55 PM.png
Screen Shot 2021-01-20 at 5.23.17 PM.png
Screen Shot 2021-01-20 at 5.21.48 PM.png

I have a listing site set up. I have a custom role called "artist" and a cpt called "artists". I have a front end user page setup and a view to show the listings of logged in user. I have all of the mentioned so far working fine.

I'm trying to assign a post to the test "artist" user. I used this method to get the artists to show up as an option on my test post. By following this https://toolset.com/forums/topic/cant-add-new-user-with-new-custom-role-as-author/

I was able to change it once to a test artist, but was not able to see the "edit post" link, when logged in as them.

Then the author dropdown disappeared.

#1912813

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Do you mean that you have a Toolset Edit form created using Toolset Form and when you click on that Edit link you want to see that author (role) dropdown on your edit form? If this is correct - there is no such feature to add a author dropdown to the Toolset edit form.

But, there is a workaround, you can add a generic select field and define your roles as the dorpdown select options and then we can use the Toolset Forms API hook cred_save_data to change the role.
=> https://toolset.com/course-lesson/adding-generic-fields-to-forms/
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

But you first need to confirm that this is the thing you want what I mentioned above.

#1913641

Sorry, No. I do have a toolset edit form and it works as expected. What I'm looking for is to be able to change the post author to a different user. The only options I'm getting for changing the author are admins. I need the users that are assigned to the custom role "artists" to be an option.

Can you watch this quick screencast to see what I mean?
versteckter Link

#1914187

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Ok great - thanks for sharing the video, that clarifies it.

You want to have artist authors displayed with your author dropdown.

Can you please share access details so I can see whats going wrong.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1918871

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Can you please check now.

I've added the following code to "Custom Code" section offered by Toolset:
=> versteckter Link

function func_quick_edit_autor_dropdown( $query_args, $r ) {
    
// adjust role names you want to display with author dropdown
    $query_args['role_in'] = array('administrator','artist','author');
    
    // Unset the 'who' as this defaults to the 'author' role
    unset( $query_args['who'] );
    
    return $query_args;
}
add_filter( 'wp_dropdown_users_args', 'func_quick_edit_autor_dropdown', 10, 2 );

I can see artist role now. You can adjust the roles you want to display with the above code.

#1919613

Fabulous! Thank you. I was able to implement that on the live site and it works.

However, now, when I login in as an artist, I'm not seeing the edit button on the post I created. I'm seeing it on the dev site that you were on, but not my live site. Did you change access permissions on the dev site? It's not working as expected on either site.

On the LIVE site, I login as an artist and I see the listing I "own" but I don't see the "edit listing" button. When I'm logged in on the DEV site, I see my listing and the "edit listing" button, but I also have access to the backend and other posts, which we do not want.

versteckter Link

#1919637

I figured it out. I just needed to give "toolset forms" access to my user role. My issue is resolved now. Thank you!