auto publish ads with a condition of finding duplicate titles
Not sure if some one would have already asked this question:
I want to auto publish ads with a condition:
Example:
ad 1 title name:
http://localhost/wordpress/this-is-sample-ad/
when i am auto publishing ad 2 with same title name "this-is-sample-ad" it should check the database for duplicate title names and send ad 2 to "pending review" or "draft" instead of auto publishing with
http://localhost/wordpress/this-is-sample-ad-2/
I believe this can be done with regular expression, but not sure where to start with, any ideas?