Support » Fixing WordPress » Changing Post Data with Function

  • Resolved fatalx

    (@fatalx)


    Hello,

    I would like to find out how I could change the post_status and post_date from inside a function (plugin).

    I have used wp_insert_post_data to edit the post_status and post_date before but now I need a scheduled event that will call a function and that function must change a posts status and date.

    Any idea how this could be done?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You will want to research WordPress implementation of cron jobs. You can read how to schedule an event in the Codex.

    I ended up fixing my issue by using the $wpdb global and changing the post_status directly in the database. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing Post Data with Function’ is closed to new replies.