Changeset 2529462
- Timestamp:
- 05/11/2021 03:18:52 AM (5 years ago)
- Location:
- also-in-this-series/trunk
- Files:
-
- 6 edited
-
plugin-core.php (modified) (3 diffs)
-
plugin-widgets.php (modified) (4 diffs)
-
plugin.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
views/admin/settings.php (modified) (1 diff)
-
views/admin/widget-form.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
also-in-this-series/trunk/plugin-core.php
r2528564 r2529462 21 21 $fargs = wp_parse_args( $args, [ 22 22 'series-slug' => null, 23 'seriesSlug' => null, // legacy arg23 'seriesSlug' => null, // legacy param 24 24 'use-frame' => true, 25 25 'frame-width' => false, 26 26 'sort-order' => false, 27 'order' => false, // legacy var27 'order' => false, // legacy param 28 28 ] ); 29 29 … … 48 48 $framewidth = $fargs['framewidth']; 49 49 $sortorder = $fargs['sortorder']; 50 $framing = $post && $useframe && $framewidth;51 50 52 51 if( $seriesslug ) { … … 78 77 $postsinseries = get_posts( $query ); 79 78 79 $framing = $post && $useframe && $framewidth; 80 80 if( $framing ) { 81 81 $pivot = 0; -
also-in-this-series/trunk/plugin-widgets.php
r2528557 r2529462 6 6 7 7 class SeriesWidget extends WP_Widget { 8 9 8 function __construct() { 10 9 parent::__construct( … … 16 15 17 16 public function widget( $widget, $fields ) { 18 $f ields = wp_parse_args( $fields, [17 $ffields = wp_parse_args( $fields, [ 19 18 'series-slug' => false, 20 19 'series-use-frame' => false, 20 'series-frame-width' => false, 21 'series-sort-order' => false, 21 22 ] ); 22 23 23 $seriesslug = apply_filters( 'alsointhisseries_widget_seriesslug', $fields['series-slug'] ); 24 $useframe = apply_filters( 'alsointhisseries_widget_useframe', $fields['series-use-frame'] ); 24 $ffields = apply_filters( 'alsointhisseries_widget_fields', $ffields, $widget ); 25 26 $seriesslug = $ffields['series-slug']; 27 $useframe = $ffields['series-use-frame']; 28 $framewidth = $ffields['series-frame-width']; 29 $sortorder = $ffields['series-sort-order']; 25 30 26 31 ob_start(); 27 displaySeries( [ 'series-slug' => $seriesslug, 'use-frame' => $useframe ] ); 32 displaySeries( [ 33 'series-slug' => $seriesslug, 34 'use-frame' => $useframe, 35 'frame-width' => $framewidth, 36 'sort-order' => $sortorder, 37 ] ); 28 38 $serieslisting = ob_get_contents(); 29 39 ob_end_clean(); … … 36 46 'series-slug' => false, 37 47 'series-use-frame' => false, 48 'series-frame-width' => false, 49 'series-sort-order' => false, 38 50 ] ); 39 51 40 52 $seriesslug = $ffields['series-slug']; 41 53 $useframe = $ffields['series-use-frame']; 54 $framewidth = $ffields['series-frame-width']; 55 $sortorder = $ffields['series-sort-order']; 42 56 43 57 $series = get_terms( SERIES_TAXONOMY ); … … 50 64 $fields['series-slug'] = isset( $new_fields['series-slug'] ) ? strip_tags( $new_fields['series-slug'] ) : false; 51 65 $fields['series-use-frame'] = isset( $new_fields['series-use-frame'] ) ? strip_tags( $new_fields['series-use-frame'] ) : false; 66 $fields['series-frame-width'] = isset( $new_fields['series-frame-width'] ) ? strip_tags( $new_fields['series-frame-width'] ) : false; 67 $fields['series-sort-order'] = isset( $new_fields['series-sort-order'] ) ? strip_tags( $new_fields['series-sort-order'] ) : false; 52 68 53 69 return $fields; 54 70 } 55 56 71 } 57 72 -
also-in-this-series/trunk/plugin.php
r2528564 r2529462 4 4 Plugin URI: https://planetjon.ca/projects/also-in-this-series/ 5 5 Description: Group related posts in a series with a custom Series taxonomy. and a list of all posts in the series in your content. 6 Version: 1.7. 26 Version: 1.7.3 7 7 Requires at least: 3.5.0 8 8 Requires PHP: 5.4 -
also-in-this-series/trunk/readme.txt
r2528564 r2529462 6 6 Requires PHP: 5.4 7 7 Tested up to: 5.7.1 8 Stable tag: 1.7. 28 Stable tag: 1.7.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Group related posts in a series with a custom Series taxonomy. and a list of all posts in the series in yourcontent.12 Group related posts in a post series and automatically list all of the posts in the series as part of the content. 13 13 14 14 == Description == 15 15 16 Group related posts in a series with a custom Series taxonomy. Automatically insert a list of all posts in the series in your content, 17 or use the [alsointhisseries] shortcode to manually insert as needed. To manually insert an arbitraty series, use the series parameter in the shortcode 18 [alsointhisseries series-slug="your-series-slug"] 16 Group related posts in a series. Automatically insert a list of all posts in the series as part of the content. 17 Manually embed a series listing with the provided shortcode and widget. Override the series template with a custom template. 18 19 A great [rundown of the plugin](https://planetjon.ca/4823/making-a-blog-series-with-also-in-this-series "How to use Also In This Series") is available on the Planetjon blog. 20 21 === Shortcode === 22 23 To manually insert the series listing of a post within a series as part of the content, use the shortcode [alsointhisseries]. 24 This will have no effect if the post isn't ikn a series. 25 26 To manually insert a specific series, use the series-slug attribute with the shortcode like [alsointhisseries series-slug="your-series-slug"]. 27 28 29 The shortcode attributes are 30 31 * series-slug="slug" 32 * use-frame="yes|no" 33 * frame-width="number" 34 * sort-order="asc|desc" 35 36 === Widget === 37 38 A widget that exposes all of the above options is available. 19 39 20 40 === Custom Template === … … 37 57 == Changelog == 38 58 59 = 1.7.3 = 60 * Resolved issue with series framing. 61 * Exposed more options to the widget interface. 62 39 63 = 1.7.1 = 40 64 * Significant updates to the codebase to facilitate future updates. -
also-in-this-series/trunk/views/admin/settings.php
r2528557 r2529462 1 1 <div class="wrap"> 2 2 <div id="icon-themes" class="icon32"></div> 3 <h2> Also In This Series Settings</h2>3 <h2><?php _e( 'Also In This Series Settings', 'also-in-this-series' ) ?></h2> 4 4 <?php //settings_errors() ?> 5 5 <form method="post" action="options.php"> -
also-in-this-series/trunk/views/admin/widget-form.php
r2528557 r2529462 1 1 <div class="also-in-this-series-widget-form"> 2 2 <p> 3 <label><?php _e( 'Select series', 'also-in-this-series' ) ?></label> 3 4 <select id="<?php echo $this->get_field_id( 'series-slug' ) ?>" name="<?php echo $this->get_field_name( 'series-slug' ) ?>"> 4 <option ><?php _e( 'Use Current Post Series', 'also-in-this-series' ) ?></option>5 <option value=""><?php _e( 'Use Current Post Series', 'also-in-this-series' ) ?></option> 5 6 <optgroup label="<?php _e( 'Available Series', 'also-in-this-series' ) ?>"> 6 7 <?php foreach( $series as $s ) : ?> … … 11 12 </p> 12 13 <p> 13 <label>Use frame? 14 <input 15 type="checkbox" 16 id="<?php echo $this->get_field_id( 'series-use-frame' ) ?>" 17 name="<?php echo $this->get_field_name( 'series-use-frame' ) ?>" 18 value="yes" 19 <?php checked( $useframe, 'yes' ) ?> /> 20 </label> 14 <label><?php _e( 'Window series listing?', 'also-in-this-series' ) ?></label> 15 <select id="<?php echo $this->get_field_id( 'series-use-frame' ) ?>" name="<?php echo $this->get_field_name( 'series-use-frame' ) ?>"> 16 <option value=""><?php _e( 'Default', 'also-in-this-series' ) ?></option> 17 <option value="yes" <?php selected( $useframe, 'yes' ) ?>><?php _e( 'Yes', 'also-in-this-series' ) ?></option> 18 <option value="no" <?php selected( $useframe, 'no' ) ?>><?php _e( 'No', 'also-in-this-series' ) ?></option> 19 </select> 20 </p> 21 <p> 22 <label><?php _e( 'Set window size', 'also-in-this-series' ) ?></label> 23 <input 24 type="number" 25 id="<?php echo $this->get_field_id( 'series-frame-width' ) ?>" 26 name="<?php echo $this->get_field_name( 'series-frame-width' ) ?>" 27 value="<?php echo esc_attr( $framewidth ) ?>" 28 placeholder="Leave blank for default setting" 29 /> 30 </p> 31 <p> 32 <label><?php _e( 'Series listing order', 'also-in-this-series' ) ?></label> 33 <select id="<?php echo $this->get_field_id( 'series-sort-order' ) ?>" name="<?php echo $this->get_field_name( 'series-sort-order' ) ?>"> 34 <option value=""><?php _e( 'Default', 'also-in-this-series' ) ?></option> 35 <option value="asc" <?php selected( $sortorder, 'asc' ) ?>><?php _e( 'Oldest to newest', 'also-in-this-series' ) ?></option> 36 <option value="desc" <?php selected( $sortorder, 'desc' ) ?>><?php _e( 'Newest to oldest', 'also-in-this-series' ) ?></option> 37 </select> 21 38 </p> 22 39 </div>
Note: See TracChangeset
for help on using the changeset viewer.