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.

I have a friend who is trying to control when posts get added to the RSS feed, not when they get added to the site. Is there a way to duplicate the date published section in admin, but for the RSS feed so they can be scheduled separately?

share|improve this question
    
Can you go into detail regarding why you want to do this? –  EAMann May 15 '13 at 16:03
    
All posts in the newsletter go on the site at the beginning of the month, but they want to push individual ones out onto the RSS feed at individual times rather than just when they're published to the site. –  Christopher May 15 '13 at 21:16

1 Answer 1

up vote 1 down vote accepted

Your question is pretty minimal but I will give it a shot.

  1. You would want to add a meta box for your value.
  2. On save_post save the data to $wpdb->postmeta
  3. Filter your feed using pre_get_posts and/or posts_where as needed.

A very basic code outline:

function generic_box() {
    add_meta_box(
        'generic_box', // id, used as the html id att
        __( 'Generic Title' ), // meta box title
        'generic_cb', // callback function, spits out the content
        'post', // post type or page. This adds to posts only
        'side', // context, where on the screen
        'low' // priority, where should this go in the context
    );
}
function generic_cb() {
  echo 'generic content';
}
add_action( 'add_meta_boxes', 'generic_box' );

function generic_save($post_id) {
  // use $post_id and the global $_POST variable to process information
  // use update_post_meta() to save information
}
add_action('save_post','generic_save');

function generic_pre_get_posts($qry) {
  if (is_feed()) {
    // alter your query
  }
}
add_action('pre_get_posts','generic_pre_get_posts');
share|improve this answer

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.