WordPress.org

Support

Support » Plugins and Hacks » Hacks » Automatic delete post in P2 theme

Automatic delete post in P2 theme

  • Hi,
    How can I set my site to automatic delete post from member after a period of time and enable members to do so such as: disable the delete function or set the time.
    Do you have any suggestion?
    Thanks for your helps.

Viewing 1 replies (of 1 total)
  • A scheduled event could take care of deleting posts of certain users older than a certain time period. You of course need to store this data somewhere, usermeta is one such place. The lack of such meta data or a 0 value could indicate to your scheduled delete old post function to not delete anything.

    You can add this time setting to the user profile page using the ‘personal_options’ action, which fires after the last table row before the table close tag is output, so your code should echo a table row and table cells to contain your form fields. Match the class of other table content to obtain the same styling.

    Save the value to usermeta from the contents of $_POST by hooking the action ‘profile_update’.

Viewing 1 replies (of 1 total)
  • The topic ‘Automatic delete post in P2 theme’ is closed to new replies.