Skip Navigation

[Resolved] Prevent duplicate post titles from being created

This support ticket is created 5 years, 4 months ago. 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
- 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)

This topic contains 17 replies, has 2 voices.

Last updated by duongN-3 5 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#1371211

Thank you for the updated code! I think it's working as expected now.

One more thing: I'd like to add this to multiple post types. Can I update the post type in the code like below?

$args = array( "post_type" => array('drama', 'movie', 'special', 'person', 'fansubber'), "name" => $title, "post_status" => array('publish', 'pending') );

Thank you again!

#1371227

You're very welcome and glad that the code is working as expected now.

And yes your updated line should work to fetch the titles from multiple post types, for the comparison.

regards,
Waqar

#1371669

My issue is resolved now. Thank you!