Skip to content

Commit

Permalink
Scheduled post handling!
Browse files Browse the repository at this point in the history
Closes #7
  • Loading branch information
mikejolley committed Nov 26, 2015
1 parent 804a7ec commit c1b0292
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mike.jol
Tags: series, posts, post series, post
Requires at least: 3.8
Tested up to: 4.4
Stable tag: 1.0.2
Stable tag: 1.1.0

Setup a series of posts using a new taxonomy. Posts within a series will show an info box above the content with links to other posts in the series.

Expand Down Expand Up @@ -52,7 +52,8 @@ The manual installation method involves downloading the plugin and uploading it

== Changelog ==

= 1.0.2 =
= 1.1.0 =
* Scheduled post handling! Scheduled posts will contribute to your series count, and the title and scheduled date will be listed along with your other series items.
* Removed bundled language files.
* Added POT file.

Expand Down
10 changes: 5 additions & 5 deletions templates/series-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
} else {
$series_name = esc_html( $series->name );
}
printf( __( 'This is post #%d of %d in the series <em>&ldquo;%s&rdquo;</em>', 'wp-post-series' ), $post_in_series, sizeof( $posts_in_series ), $series_name );
printf( __( 'This is post %d of %d in the series <em>&ldquo;%s&rdquo;</em>', 'wp-post-series' ), $post_in_series, sizeof( $posts_in_series ), $series_name );
?>
</p>

Expand All @@ -16,9 +16,9 @@
<ol>
<?php foreach ( $posts_in_series as $key => $post_id ) : ?>
<li>
<?php if ( ! is_single( $post_id ) ) echo '<a href="' . get_permalink( $post_id ) . '">'; ?>
<?php echo get_the_title( $post_id ); ?>
<?php if ( ! is_single( $post_id ) ) echo '</a>'; ?>
<?php if ( ! is_single( $post_id ) && 'publish' === get_post_status( $post_id ) ) echo '<a href="' . get_permalink( $post_id ) . '">'; ?>
<?php echo 'publish' === get_post_status( $post_id ) ? get_the_title( $post_id ) : sprintf( __( '%s &ndash; <em>Scheduled for %s</em>', 'wp-post-series' ), get_the_title( $post_id ), get_post_time( get_option( 'date_format' ), false, $post_id ) ); ?>
<?php if ( ! is_single( $post_id ) && 'publish' === get_post_status( $post_id ) ) echo '</a>'; ?>
</li>
<?php endforeach; ?>
</ol>
Expand All @@ -31,4 +31,4 @@
<?php endif; ?>

<?php endif; ?>
</aside>
</aside>
5 changes: 3 additions & 2 deletions wp-post-series.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Post Series
* Plugin URI: https://github.com/mikejolley/wp-post-series
* Description: Lets you setup a simple series of posts using taxonomies. Posts within a series will show an information box above the content automatically with links to other posts in the series and a description.
* Version: 1.0.2
* Version: 1.1.0
* Author: Mike Jolley
* Author URI: http://mikejolley.com
* Requires at least: 3.8
Expand All @@ -22,7 +22,7 @@ class WP_Post_Series {
*/
public function __construct() {
// Define constants
define( 'WP_POST_SERIES_VERSION', '1.0.2' );
define( 'WP_POST_SERIES_VERSION', '1.1.0' );
define( 'WP_POST_SERIES_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'WP_POST_SERIES_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );

Expand Down Expand Up @@ -237,6 +237,7 @@ public function add_series_to_content( $content ) {
'no_found_rows' => true,
'orderby' => 'date',
'order' => 'asc',
'post_status' => array( 'publish', 'future' ),
'tax_query' => array(
array(
'taxonomy' => 'post_series',
Expand Down

0 comments on commit c1b0292

Please sign in to comment.