Admin Post Navigation - Version 1.9.2

Version Description

Bugfix: fix to display navigation links in WordPress 4.3; noted compatibility through WP 4.3+

Download this release

Release Info

Developer coffee2code
Plugin Icon 128x128 Admin Post Navigation
Version 1.9.2
Comparing to
See all releases

Code changes from version 1.9.1 to 1.9.2

admin-post-navigation.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: Admin Post Navigation
4
- * Version: 1.9.1
5
  * Plugin URI: http://coffee2code.com/wp-plugins/admin-post-navigation/
6
  * Author: Scott Reilly
7
  * Author URI: http://coffee2code.com/
@@ -11,7 +11,7 @@
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  * Description: Adds links to navigate to the next and previous posts when editing a post in the WordPress admin.
13
  *
14
- * Compatible with WordPress 3.0 through 4.2+.
15
  *
16
  * =>> Read the accompanying readme.txt file for instructions and documentation.
17
  * =>> Also, visit the plugin's homepage for additional information and updates.
@@ -19,7 +19,7 @@
19
  *
20
  * @package Admin_Post_Navigation
21
  * @author Scott Reilly
22
- * @version 1.9.1
23
  */
24
 
25
  /*
@@ -69,7 +69,7 @@ class c2c_AdminPostNavigation {
69
  * @since 1.7
70
  */
71
  public static function version() {
72
- return '1.9.1';
73
  }
74
 
75
  /**
@@ -211,10 +211,12 @@ HTML;
211
  * navigation links can be found there.
212
  */
213
  public static function add_js() {
 
 
214
  echo <<<JS
215
  <script type="text/javascript">
216
  jQuery(document).ready(function($) {
217
- $('#admin-post-nav').appendTo($('#wpbody-content .wrap:first h2:first'));
218
  $('#adminpostnav, label[for="adminpostnav-hide"]').hide();
219
  });
220
  </script>
1
  <?php
2
  /**
3
  * Plugin Name: Admin Post Navigation
4
+ * Version: 1.9.2
5
  * Plugin URI: http://coffee2code.com/wp-plugins/admin-post-navigation/
6
  * Author: Scott Reilly
7
  * Author URI: http://coffee2code.com/
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  * Description: Adds links to navigate to the next and previous posts when editing a post in the WordPress admin.
13
  *
14
+ * Compatible with WordPress 3.0 through 4.3+.
15
  *
16
  * =>> Read the accompanying readme.txt file for instructions and documentation.
17
  * =>> Also, visit the plugin's homepage for additional information and updates.
19
  *
20
  * @package Admin_Post_Navigation
21
  * @author Scott Reilly
22
+ * @version 1.9.2
23
  */
24
 
25
  /*
69
  * @since 1.7
70
  */
71
  public static function version() {
72
+ return '1.9.2';
73
  }
74
 
75
  /**
211
  * navigation links can be found there.
212
  */
213
  public static function add_js() {
214
+ $tag = version_compare( $GLOBALS['wp_version'], '4.3', '>=' ) ? 'h1' : 'h2';
215
+
216
  echo <<<JS
217
  <script type="text/javascript">
218
  jQuery(document).ready(function($) {
219
+ $('#admin-post-nav').appendTo($('#wpbody-content .wrap:first {$tag}:first'));
220
  $('#adminpostnav, label[for="adminpostnav-hide"]').hide();
221
  });
222
  </script>
readme.txt CHANGED
@@ -5,8 +5,8 @@ Tags: admin, navigation, post, next, previous, edit, post types, coffee2code
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.0
8
- Tested up to: 4.2
9
- Stable tag: 1.9.1
10
 
11
  Adds links to navigate to the next and previous posts when editing a post in the WordPress admin.
12
 
@@ -227,6 +227,10 @@ add_filter( 'c2c_admin_post_navigation_display', 'override_apn_display' );
227
 
228
  == Changelog ==
229
 
 
 
 
 
230
  = 1.9.1 (2015-07-08) =
231
  * Bugfix: Fix JS placement of navigation links to target the desired h2, which may not always be the first on the page
232
  * Update: Add additional unit test using example for customizing post status navigation
@@ -364,6 +368,9 @@ add_filter( 'c2c_admin_post_navigation_display', 'override_apn_display' );
364
 
365
  == Upgrade Notice ==
366
 
 
 
 
367
  = 1.9.1 =
368
  Minor bugfix: fix to more reliably ensure the navigation links appear in certain situations; fix incorrect example code for excluding post statuses; noted compatibility through WP 4.2+
369
 
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.0
8
+ Tested up to: 4.3
9
+ Stable tag: 1.9.2
10
 
11
  Adds links to navigate to the next and previous posts when editing a post in the WordPress admin.
12
 
227
 
228
  == Changelog ==
229
 
230
+ = 1.9.2 (2015-08-19) =
231
+ * Bugfix: Fix so navigation links appear in WordPress 4.3 (by targeting h1 instead of h2). Backwards compatibility maintained.
232
+ * Update: Note compatibility through WP 4.3+
233
+
234
  = 1.9.1 (2015-07-08) =
235
  * Bugfix: Fix JS placement of navigation links to target the desired h2, which may not always be the first on the page
236
  * Update: Add additional unit test using example for customizing post status navigation
368
 
369
  == Upgrade Notice ==
370
 
371
+ = 1.9.2 =
372
+ Bugfix: fix to display navigation links in WordPress 4.3; noted compatibility through WP 4.3+
373
+
374
  = 1.9.1 =
375
  Minor bugfix: fix to more reliably ensure the navigation links appear in certain situations; fix incorrect example code for excluding post statuses; noted compatibility through WP 4.2+
376
 
tests/test-admin-post-navigation.php CHANGED
@@ -103,7 +103,7 @@ class Admin_Post_Navigation_Test extends WP_UnitTestCase {
103
  }
104
 
105
  function test_version() {
106
- $this->assertEquals( '1.9.1', c2c_AdminPostNavigation::version() );
107
  }
108
 
109
  /*
103
  }
104
 
105
  function test_version() {
106
+ $this->assertEquals( '1.9.2', c2c_AdminPostNavigation::version() );
107
  }
108
 
109
  /*