Changeset 3254130
- Timestamp:
- 03/11/2025 02:35:01 PM (13 months ago)
- Location:
- keep-pagination-in-same-taxonomy
- Files:
-
- 1 added
- 4 edited
- 1 copied
-
assets/screenshot-1.png (added)
-
tags/0.14 (copied) (copied from keep-pagination-in-same-taxonomy/trunk)
-
tags/0.14/keep-pagination-in-same-taxonomy.php (modified) (9 diffs)
-
tags/0.14/readme.txt (modified) (2 diffs)
-
trunk/keep-pagination-in-same-taxonomy.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
keep-pagination-in-same-taxonomy/tags/0.14/keep-pagination-in-same-taxonomy.php
r2991897 r3254130 2 2 /* 3 3 Plugin Name: Keep Pagination in Same Taxonomy 4 Version: 0.1 34 Version: 0.14 5 5 Description: Makes the previous/next post links use the same taxonomy as the current post. Select which taxonomies are affected in Settings-><strong>Reading</strong>. 6 6 Author: Keith Drakard 7 7 Author URI: https://drakard.com/ 8 License: BSD-3-Clause 8 9 */ 9 10 … … 11 12 12 13 public function __construct() { 13 load_plugin_textdomain('KeepPaginationInSameTaxonomy', false, plugin_dir_path(__FILE__).'/languages'); 14 15 add_action('init', function() { load_plugin_textdomain('keep-pagination-in-same-taxonomy', false, plugin_dir_path(__FILE__).'/languages'); }); 14 16 15 17 $this->settings = get_option('KeepPaginationInSameTaxonomyPlugin', array( … … 40 42 ksort($this->taxonomies); 41 43 $this->toggles = array( 42 'all' => __('ALL', ' KeepPaginationInSameTaxonomy'),43 'any' => __('ANY', ' KeepPaginationInSameTaxonomy'),44 'all' => __('ALL', 'keep-pagination-in-same-taxonomy'), 45 'any' => __('ANY', 'keep-pagination-in-same-taxonomy'), 44 46 ); 45 47 add_action('admin_init', array($this, 'settings_init')); … … 48 50 49 51 50 /******************************************************************************************************************************************************* ***********/52 /*******************************************************************************************************************************************************/ 51 53 52 54 … … 60 62 61 63 public function settings_form() { 64 65 wp_nonce_field('save_kpist_settings', '_KeepPaginationInSameTaxonomy_nonce'); 66 62 67 $output = '<table class="form-table" role="presentation"><tbody>'; 63 68 64 $output.= '<tr><th scope="row">'.__('Keep Pagination in Same Taxonomy', ' KeepPaginationInSameTaxonomy').'</th>'65 . '<td><fieldset><legend class="screen-reader-text">'.__('Keep Pagination in Same Taxonomy', ' KeepPaginationInSameTaxonomy').'</legend>';69 $output.= '<tr><th scope="row">'.__('Keep Pagination in Same Taxonomy', 'keep-pagination-in-same-taxonomy').'</th>' 70 . '<td><fieldset><legend class="screen-reader-text">'.__('Keep Pagination in Same Taxonomy', 'keep-pagination-in-same-taxonomy').'</legend>'; 66 71 67 72 foreach ($this->taxonomies as $key => $obj) { … … 73 78 74 79 $output.= '<p class="description">' 75 . __('Posts that have one of the selected taxonomies will have their Previous/Next Post links directed to other posts that share their taxonomy.', ' KeepPaginationInSameTaxonomy')80 . __('Posts that have one of the selected taxonomies will have their Previous/Next Post links directed to other posts that share their taxonomy.', 'keep-pagination-in-same-taxonomy') 76 81 . '</p><br>'; 77 82 … … 85 90 86 91 $output.= '<p class="description">' 87 . __('Selecting ALL will only join posts that share at least one common term in ALL of the chosen taxonomies; selecting ANY will join posts that share at least one common term across ANY of the chosen taxonomies.', ' KeepPaginationInSameTaxonomy')92 . __('Selecting ALL will only join posts that share at least one common term in ALL of the chosen taxonomies; selecting ANY will join posts that share at least one common term across ANY of the chosen taxonomies.', 'keep-pagination-in-same-taxonomy') 88 93 . '</p>'; 89 94 … … 96 101 public function validate_settings($input) { 97 102 if (! isset($input) OR ! isset($_POST['KeepPaginationInSameTaxonomyPlugin']) OR 98 ! is_array($input) OR ! is_array($_POST['KeepPaginationInSameTaxonomyPlugin']) 103 ! is_array($input) OR ! is_array($_POST['KeepPaginationInSameTaxonomyPlugin']) OR 104 (! isset($_POST['_KeepPaginationInSameTaxonomy_nonce'] ) OR ! wp_verify_nonce($_POST['_KeepPaginationInSameTaxonomy_nonce'], 'save_kpist_settings')) 99 105 ) return false; 100 106 … … 116 122 117 123 118 /******************************************************************************************************************************************************************/ 124 /*******************************************************************************************************************************************************/ 125 119 126 120 127 public function same_pagination($post = null) { -
keep-pagination-in-same-taxonomy/tags/0.14/readme.txt
r3067456 r3254130 3 3 Author Link: https://drakard.com/ 4 4 Requires at least: 4.0 or higher 5 Tested up to: 6. 55 Tested up to: 6.7.2 6 6 Requires PHP: 5.6 7 Stable tag: 0.1 37 Stable tag: 0.14 8 8 License: BSD-3-Clause 9 9 License URI: https://directory.fsf.org/wiki/License:BSD-3-Clause 10 Tags: previous next posts, link posts, post navigation, navigation, previous post, next post, previous/next links, pagination, taxonomy pagination 10 Tags: previous next posts, link posts, post navigation, previous/next links, pagination 11 11 12 12 13 Makes any previous/next post links use the same taxonomy as the current post. 14 13 15 14 16 == Description == … … 41 43 == Screenshots == 42 44 45 1. The settings form (on the Reading admin page). 43 46 44 47 45 48 == Changelog == 46 49 50 = 0.14 = 51 * Tested with WP 6.7.2 52 * Fix: moved the translation text domain loading to later in the init and changed it to be the plugin slug 53 47 54 = 0.13 = 48 55 * Tested with WP 6.4 and 6.5 49 * Bugfix: only show public taxonomies in the Settings50 * Bugfix: call our Settings page later in the init() hook so we can include custom taxonomies (was inadvertently dependent on plugin activation order before)56 * Fix: only show public taxonomies in the Settings 57 * Fix: call our Settings page later in the init() hook so we can include custom taxonomies (was inadvertently dependent on plugin activation order before) 51 58 52 59 = 0.12 = 53 * No changes, just a version number bump54 60 * Tested with WP 6.3.2 55 61 56 62 = 0.11 = 57 * Bugfix: check if we've excluded all the terms from a taxonomy63 * Fix: check if we've excluded all the terms from a taxonomy 58 64 59 65 = 0.1 = 60 66 * Initial release. 61 67 62 63 64 == Upgrade Notice ==65 66 -
keep-pagination-in-same-taxonomy/trunk/keep-pagination-in-same-taxonomy.php
r2991897 r3254130 2 2 /* 3 3 Plugin Name: Keep Pagination in Same Taxonomy 4 Version: 0.1 34 Version: 0.14 5 5 Description: Makes the previous/next post links use the same taxonomy as the current post. Select which taxonomies are affected in Settings-><strong>Reading</strong>. 6 6 Author: Keith Drakard 7 7 Author URI: https://drakard.com/ 8 License: BSD-3-Clause 8 9 */ 9 10 … … 11 12 12 13 public function __construct() { 13 load_plugin_textdomain('KeepPaginationInSameTaxonomy', false, plugin_dir_path(__FILE__).'/languages'); 14 15 add_action('init', function() { load_plugin_textdomain('keep-pagination-in-same-taxonomy', false, plugin_dir_path(__FILE__).'/languages'); }); 14 16 15 17 $this->settings = get_option('KeepPaginationInSameTaxonomyPlugin', array( … … 40 42 ksort($this->taxonomies); 41 43 $this->toggles = array( 42 'all' => __('ALL', ' KeepPaginationInSameTaxonomy'),43 'any' => __('ANY', ' KeepPaginationInSameTaxonomy'),44 'all' => __('ALL', 'keep-pagination-in-same-taxonomy'), 45 'any' => __('ANY', 'keep-pagination-in-same-taxonomy'), 44 46 ); 45 47 add_action('admin_init', array($this, 'settings_init')); … … 48 50 49 51 50 /******************************************************************************************************************************************************* ***********/52 /*******************************************************************************************************************************************************/ 51 53 52 54 … … 60 62 61 63 public function settings_form() { 64 65 wp_nonce_field('save_kpist_settings', '_KeepPaginationInSameTaxonomy_nonce'); 66 62 67 $output = '<table class="form-table" role="presentation"><tbody>'; 63 68 64 $output.= '<tr><th scope="row">'.__('Keep Pagination in Same Taxonomy', ' KeepPaginationInSameTaxonomy').'</th>'65 . '<td><fieldset><legend class="screen-reader-text">'.__('Keep Pagination in Same Taxonomy', ' KeepPaginationInSameTaxonomy').'</legend>';69 $output.= '<tr><th scope="row">'.__('Keep Pagination in Same Taxonomy', 'keep-pagination-in-same-taxonomy').'</th>' 70 . '<td><fieldset><legend class="screen-reader-text">'.__('Keep Pagination in Same Taxonomy', 'keep-pagination-in-same-taxonomy').'</legend>'; 66 71 67 72 foreach ($this->taxonomies as $key => $obj) { … … 73 78 74 79 $output.= '<p class="description">' 75 . __('Posts that have one of the selected taxonomies will have their Previous/Next Post links directed to other posts that share their taxonomy.', ' KeepPaginationInSameTaxonomy')80 . __('Posts that have one of the selected taxonomies will have their Previous/Next Post links directed to other posts that share their taxonomy.', 'keep-pagination-in-same-taxonomy') 76 81 . '</p><br>'; 77 82 … … 85 90 86 91 $output.= '<p class="description">' 87 . __('Selecting ALL will only join posts that share at least one common term in ALL of the chosen taxonomies; selecting ANY will join posts that share at least one common term across ANY of the chosen taxonomies.', ' KeepPaginationInSameTaxonomy')92 . __('Selecting ALL will only join posts that share at least one common term in ALL of the chosen taxonomies; selecting ANY will join posts that share at least one common term across ANY of the chosen taxonomies.', 'keep-pagination-in-same-taxonomy') 88 93 . '</p>'; 89 94 … … 96 101 public function validate_settings($input) { 97 102 if (! isset($input) OR ! isset($_POST['KeepPaginationInSameTaxonomyPlugin']) OR 98 ! is_array($input) OR ! is_array($_POST['KeepPaginationInSameTaxonomyPlugin']) 103 ! is_array($input) OR ! is_array($_POST['KeepPaginationInSameTaxonomyPlugin']) OR 104 (! isset($_POST['_KeepPaginationInSameTaxonomy_nonce'] ) OR ! wp_verify_nonce($_POST['_KeepPaginationInSameTaxonomy_nonce'], 'save_kpist_settings')) 99 105 ) return false; 100 106 … … 116 122 117 123 118 /******************************************************************************************************************************************************************/ 124 /*******************************************************************************************************************************************************/ 125 119 126 120 127 public function same_pagination($post = null) { -
keep-pagination-in-same-taxonomy/trunk/readme.txt
r3067456 r3254130 3 3 Author Link: https://drakard.com/ 4 4 Requires at least: 4.0 or higher 5 Tested up to: 6. 55 Tested up to: 6.7.2 6 6 Requires PHP: 5.6 7 Stable tag: 0.1 37 Stable tag: 0.14 8 8 License: BSD-3-Clause 9 9 License URI: https://directory.fsf.org/wiki/License:BSD-3-Clause 10 Tags: previous next posts, link posts, post navigation, navigation, previous post, next post, previous/next links, pagination, taxonomy pagination 10 Tags: previous next posts, link posts, post navigation, previous/next links, pagination 11 11 12 12 13 Makes any previous/next post links use the same taxonomy as the current post. 14 13 15 14 16 == Description == … … 41 43 == Screenshots == 42 44 45 1. The settings form (on the Reading admin page). 43 46 44 47 45 48 == Changelog == 46 49 50 = 0.14 = 51 * Tested with WP 6.7.2 52 * Fix: moved the translation text domain loading to later in the init and changed it to be the plugin slug 53 47 54 = 0.13 = 48 55 * Tested with WP 6.4 and 6.5 49 * Bugfix: only show public taxonomies in the Settings50 * Bugfix: call our Settings page later in the init() hook so we can include custom taxonomies (was inadvertently dependent on plugin activation order before)56 * Fix: only show public taxonomies in the Settings 57 * Fix: call our Settings page later in the init() hook so we can include custom taxonomies (was inadvertently dependent on plugin activation order before) 51 58 52 59 = 0.12 = 53 * No changes, just a version number bump54 60 * Tested with WP 6.3.2 55 61 56 62 = 0.11 = 57 * Bugfix: check if we've excluded all the terms from a taxonomy63 * Fix: check if we've excluded all the terms from a taxonomy 58 64 59 65 = 0.1 = 60 66 * Initial release. 61 67 62 63 64 == Upgrade Notice ==65 66
Note: See TracChangeset
for help on using the changeset viewer.