Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

With WordPress 3.0 its easy to for users to submit custom content from the front end. They don't even need to be logged in anymore.

Is there a functions code (not a plugin) to notify a predefined email, such as the site admin, of new posts in just a certain post type? For example the site admin get notified whenever a new "usernews" post type is posted?

Thanks!

share|improve this question
1  
how do you create public submission? what plugin? maybe there's a way to notify on that plugin. –  ariefbayu Nov 9 '10 at 0:39
add comment

1 Answer

up vote 1 down vote accepted

I don't know the name of a function that would do just that - but i can give you what i think is a good algorithm to do so

However, I suggest you do the following trick : Once the user publishes new content - let it have a category called "user submission" for example or any other stuff

Once an admin views the post, he can remove that category and label the content accordingly.

So all you have to do is use feedburner or any email notification system to let the people you want know about the "new posts" or RSS subscription by category

to do by programming :

1 - you have to fetch the user details for which users are admins from the tables users/usermeta

2 - in some separate table, you must have lastPostId, AdminId

3 - write a script get the posts that have an ID > lastPostId and send the email

4 - this script can be run using a cron job

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.