Post Tags and Categories for Pages - Version 1.4.1

Version Description

Download this release

Release Info

Developer curtismchale
Plugin Icon wp plugin Post Tags and Categories for Pages
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.3 to 1.4.1

Files changed (2) hide show
  1. post-tag.php +9 -7
  2. readme.txt +7 -3
post-tag.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Post Tags and Categories for Pages
4
  Plugin URI: http://wpthemetutorial.com/plugins/post-tags-and-categories-for-pages/
5
  Description: Simply adds the stock Categories and Post Tags to your Pages.
6
- Version: 1.3
7
  Author: curtismchale
8
  Author URI: http://wpthemetutotial.com/about/
9
  License: GNU General Public License v2.0
@@ -44,33 +44,35 @@ class PTCFP{
44
  } // taxonomies_for_pages
45
 
46
  /**
47
- * Includes the tags in archive pages
48
  *
49
  * Modifies the query object to include pages
50
  * as well as posts in the items to be returned
51
- * on archive pages
 
52
  *
53
  * @since 1.0
54
  */
55
  function tags_archives( $wp_query ) {
56
 
57
- if ( $wp_query->get( 'tag' ) )
58
  $wp_query->set( 'post_type', 'any' );
59
 
60
  } // tags_archives
61
 
62
  /**
63
- * Includes the categories in archive pages
64
  *
65
  * Modifies the query object to include pages
66
  * as well as posts in the items to be returned
67
- * on archive pages
 
68
  *
69
  * @since 1.0
70
  */
71
  function category_archives( $wp_query ) {
72
 
73
- if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
74
  $wp_query->set( 'post_type', 'any' );
75
 
76
  } // category_archives
3
  Plugin Name: Post Tags and Categories for Pages
4
  Plugin URI: http://wpthemetutorial.com/plugins/post-tags-and-categories-for-pages/
5
  Description: Simply adds the stock Categories and Post Tags to your Pages.
6
+ Version: 1.4.1
7
  Author: curtismchale
8
  Author URI: http://wpthemetutotial.com/about/
9
  License: GNU General Public License v2.0
44
  } // taxonomies_for_pages
45
 
46
  /**
47
+ * Includes the tags in archive and search pages
48
  *
49
  * Modifies the query object to include pages
50
  * as well as posts in the items to be returned
51
+ * on archive and search pages, but only if
52
+ * post_type is not set by another plugin/filter
53
  *
54
  * @since 1.0
55
  */
56
  function tags_archives( $wp_query ) {
57
 
58
+ if ( ( ( is_archive() || is_search() ) && $wp_query->get( 'tag' ) ) && ( ! $wp_query->get( 'post_type' ) ) )
59
  $wp_query->set( 'post_type', 'any' );
60
 
61
  } // tags_archives
62
 
63
  /**
64
+ * Includes the categories in archive and search pages
65
  *
66
  * Modifies the query object to include pages
67
  * as well as posts in the items to be returned
68
+ * on archive pages, but only if
69
+ * post_type is not set by another plugin/filter
70
  *
71
  * @since 1.0
72
  */
73
  function category_archives( $wp_query ) {
74
 
75
+ if ( ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) ) && ( ! $wp_query->get( 'post_type' ) ) )
76
  $wp_query->set( 'post_type', 'any' );
77
 
78
  } // category_archives
readme.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: Curtis McHale
4
  Tags: wp, tags, categories, pages
5
  Requires at least: 3.0
6
- Tested up to: 3.9
7
- Stable tag: 1.3
8
 
9
  Adds the built in WordPress categories and tags to your pages.
10
 
@@ -28,6 +28,10 @@ folder.
28
 
29
  == Changelog ==
30
 
 
 
 
 
31
  = 1.3 =
32
 
33
  - making the README more clear for end users
@@ -40,4 +44,4 @@ folder.
40
 
41
  = 1.0 =
42
 
43
- - relesed on WordPress repository
3
  Contributors: Curtis McHale
4
  Tags: wp, tags, categories, pages
5
  Requires at least: 3.0
6
+ Tested up to: 4.5.2
7
+ Stable tag: 1.4.1
8
 
9
  Adds the built in WordPress categories and tags to your pages.
10
 
28
 
29
  == Changelog ==
30
 
31
+ = 1.4 =
32
+
33
+ - prevented it from setting `post_type` on archive/search pages and if `post_type` was already set thanks macbookandrew
34
+
35
  = 1.3 =
36
 
37
  - making the README more clear for end users
44
 
45
  = 1.0 =
46
 
47
+ - released on WordPress repository