Post Type Archive Link - Version 1.2

Version Description

  • Use has_archive rather tha public. See #13
  • Fixes bug where "disabled" is printed if no menu has been created.
  • Tested up to 3.7.1
  • Added German language. Thanks to @mcguffin.
Download this release

Release Info

Developer stephenharris
Plugin Icon wp plugin Post Type Archive Link
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

lang/hptal-textdomain-de_DE.mo ADDED
Binary file
lang/hptal-textdomain-de_DE.po ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WordPress Post Type Archive Links v1.1\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2013-09-19 12:31:49+0000\n"
7
+ "Last-Translator: admin <joern@flyingletters.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: CSL v1.x\n"
14
+ "X-Poedit-Language: German\n"
15
+ "X-Poedit-Country: GERMANY\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
18
+ "X-Poedit-Basepath: ../\n"
19
+ "X-Poedit-Bookmarks: \n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Textdomain-Support: yes"
22
+
23
+ #. translators: plugin header field 'Name'
24
+ #: post-type-archive-links.php:0
25
+ #@ hptal-textdomain
26
+ msgid "WordPress Post Type Archive Links"
27
+ msgstr "WordPress Post-Type-Archiv Links"
28
+
29
+ #. translators: plugin header field 'PluginURI'
30
+ #: post-type-archive-links.php:0
31
+ #@ hptal-textdomain
32
+ msgid "https://github.com/stephenharris/WordPress-Post-Type-Archive-Links"
33
+ msgstr ""
34
+
35
+ #. translators: plugin header field 'Description'
36
+ #: post-type-archive-links.php:0
37
+ #@ hptal-textdomain
38
+ msgid "Adds a MetaBox to the Appearance > Menu page to add post type archive links"
39
+ msgstr "Fügt in eine Auswahl unter Design > Menüs hinzu, mit der Sie Post-Type-Archiv-Links hinzufügen können."
40
+
41
+ #. translators: plugin header field 'Author'
42
+ #: post-type-archive-links.php:0
43
+ #@ hptal-textdomain
44
+ msgid "Stephen Harris"
45
+ msgstr ""
46
+
47
+ #. translators: plugin header field 'AuthorURI'
48
+ #: post-type-archive-links.php:0
49
+ #@ hptal-textdomain
50
+ msgid "https://github.com/stephenharris/"
51
+ msgstr ""
52
+
53
+ #. translators: plugin header field 'Version'
54
+ #: post-type-archive-links.php:0
55
+ #@ hptal-textdomain
56
+ msgid "1.1"
57
+ msgstr ""
58
+
59
+ #: post-type-archive-links.php:115
60
+ #@ hptal-textdomain
61
+ msgid "Post Type Archives"
62
+ msgstr "Post-Type Archive"
63
+
post-type-archive-links.php CHANGED
@@ -4,13 +4,15 @@ defined( 'ABSPATH' ) OR exit;
4
  Plugin Name: WordPress Post Type Archive Links
5
  Plugin URI: https://github.com/stephenharris/WordPress-Post-Type-Archive-Links
6
  Description: Adds a MetaBox to the Appearance > Menu page to add post type archive links
7
- Version: 1.1
8
  Author: Stephen Harris
9
  Author URI: https://github.com/stephenharris/
10
  Author Email: contact@stephenharris.info
11
  Contributors: Franz Josef Kaiser <wecodemore@gmail.com>, Ryan Urban <ryan@fringewebdevelopment.com>
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl.txt
 
 
14
 
15
  Copyright 2013 Stephen Harris (contact@stephenharris.info)
16
 
@@ -75,6 +77,8 @@ class Post_Type_Archive_Links {
75
  * @return \Post_Type_Archive_Links
76
  */
77
  public function __construct() {
 
 
78
  add_action( 'admin_init', array( $this, 'add_meta_box' ) );
79
 
80
  add_action( 'admin_head-nav-menus.php', array( $this, 'setup_admin_hooks' ) );
@@ -161,7 +165,7 @@ class Post_Type_Archive_Links {
161
  // Get post types
162
  $post_types = get_post_types(
163
  array(
164
- 'public' => true,
165
  '_builtin' => false
166
  ),
167
  'object'
@@ -179,7 +183,7 @@ class Post_Type_Archive_Links {
179
 
180
  // 'Add to Menu' button
181
  $html .= '<p class="button-controls"><span class="add-to-menu">';
182
- $html .= '<input type="submit"'. disabled( $nav_menu_selected_id, 0 ) .' class="button-secondary
183
  submit-add-to-menu right" value="'. esc_attr( 'Add to Menu' ) .'"
184
  name="add-post-type-menu-item" id="submit-post-type-archives" />';
185
  $html .= '<span class="spinner"></span>';
4
  Plugin Name: WordPress Post Type Archive Links
5
  Plugin URI: https://github.com/stephenharris/WordPress-Post-Type-Archive-Links
6
  Description: Adds a MetaBox to the Appearance > Menu page to add post type archive links
7
+ Version: 1.2
8
  Author: Stephen Harris
9
  Author URI: https://github.com/stephenharris/
10
  Author Email: contact@stephenharris.info
11
  Contributors: Franz Josef Kaiser <wecodemore@gmail.com>, Ryan Urban <ryan@fringewebdevelopment.com>
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl.txt
14
+ Text Domain: hptal-textdomain
15
+ Domain Path: /lang/
16
 
17
  Copyright 2013 Stephen Harris (contact@stephenharris.info)
18
 
77
  * @return \Post_Type_Archive_Links
78
  */
79
  public function __construct() {
80
+ load_plugin_textdomain( 'hptal-textdomain' , false , dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
81
+
82
  add_action( 'admin_init', array( $this, 'add_meta_box' ) );
83
 
84
  add_action( 'admin_head-nav-menus.php', array( $this, 'setup_admin_hooks' ) );
165
  // Get post types
166
  $post_types = get_post_types(
167
  array(
168
+ 'has_archive' => true,
169
  '_builtin' => false
170
  ),
171
  'object'
183
 
184
  // 'Add to Menu' button
185
  $html .= '<p class="button-controls"><span class="add-to-menu">';
186
+ $html .= '<input type="submit"'. disabled( $nav_menu_selected_id, 0, false ) .' class="button-secondary
187
  submit-add-to-menu right" value="'. esc_attr( 'Add to Menu' ) .'"
188
  name="add-post-type-menu-item" id="submit-post-type-archives" />';
189
  $html .= '<span class="spinner"></span>';
readme.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Post Type Archive Link #
2
+ **Contributors:** stephenharris, F J Kaiser, ryancurban
3
+ **Tags:** post type archives, menu link, archives, navigation, metabox, administration user interface
4
+ **Requires at least:** 3.3
5
+ **Tested up to:** 3.7.1
6
+ **Stable tag:** 1.2
7
+ **License:** GPLv3 or later
8
+ **License URI:** http://www.gnu.org/licenses/gpl.txt
9
+
10
+ Creates a metabox to the Appearance > Menu page to add custom post type archive links
11
+
12
+ ## Description ##
13
+
14
+ Post Type Archive Link creates a metabox on the Appearance > Menu admin page. This lists your custom post types and allows you to add links to each archive page in your WordPress menus.
15
+
16
+ The great thing about this plugin is it integrates fully with the WordPress menus functionality, and so you will notice that your custom post type archive links that are added to your menus take advantage of the typical menu classes aded by WordPress, including the current page class.
17
+
18
+
19
+ ## Installation ##
20
+
21
+ Installation is standard and straight forward.
22
+
23
+ 1. Upload `WordPress-Post-Type-Archive-Links` folder (and all it's contents!) to the `/wp-content/plugins/` directory
24
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
25
+ 1. The metabox will appear at the bottom of your Appearance > Menu
26
+
27
+
28
+ ## Frequently Asked Questions ##
29
+
30
+ ### Why are some post types missing? ###
31
+
32
+ The metabox will only list public custom post types
33
+
34
+
35
+ ## Screenshots ##
36
+
37
+ ### 1. Custom post types admin menu metabox ###
38
+ ![Custom post types admin menu metabox](http://s.wordpress.org/extend/plugins/post-type archive link/screenshot-1.png)
39
+
40
+ ### 2. Custom post types added to your menu ###
41
+ ![Custom post types added to your menu](http://s.wordpress.org/extend/plugins/post-type archive link/screenshot-2.png)
42
+
43
+ ### 3. Custom post type 'Clients' in front-end menu with WordPress menu classes and current item styles ###
44
+ ![Custom post type 'Clients' in front-end menu with WordPress menu classes and current item styles](http://s.wordpress.org/extend/plugins/post-type archive link/screenshot-3.png)
45
+
46
+
47
+
48
+ ## Changelog ##
49
+
50
+ ### 1.2 ###
51
+ * Use has_archive rather tha public. [See #13](https://github.com/stephenharris/WordPress-Post-Type-Archive-Links/issues/13)
52
+ * Fixes bug where "disabled" is printed if no menu has been created.
53
+ * Tested up to 3.7.1
54
+ * Added German language. Thanks to [@mcguffin](https://github.com/mcguffin).
55
+
56
+ ### 1.1 ###
57
+ * Fixed a couple of notices that displayed with debug on
58
+ * Better maintainability (avoid touching JS files)
59
+ * Static init now runs during <code>plugins_loaded</code> hook
60
+ * Code cleanup and safer names
61
+
62
+ ### 1.0.1 ###
63
+ * Fixed enqueue bug
64
+
65
+ ### 1.0 ###
66
+ * Added plug-in
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: stephenharris, F J Kaiser, ryancurban
3
  Tags: post type archives, menu link, archives, navigation, metabox, administration user interface
4
  Requires at least: 3.3
5
- Tested up to: 3.5.1
6
- Stable tag: 1.1
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl.txt
9
 
@@ -41,6 +41,12 @@ The metabox will only list public custom post types
41
 
42
  == Changelog ==
43
 
 
 
 
 
 
 
44
  = 1.1 =
45
  * Fixed a couple of notices that displayed with debug on
46
  * Better maintainability (avoid touching JS files)
2
  Contributors: stephenharris, F J Kaiser, ryancurban
3
  Tags: post type archives, menu link, archives, navigation, metabox, administration user interface
4
  Requires at least: 3.3
5
+ Tested up to: 3.7.1
6
+ Stable tag: 1.2
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl.txt
9
 
41
 
42
  == Changelog ==
43
 
44
+ = 1.2 =
45
+ * Use has_archive rather tha public. [See #13](https://github.com/stephenharris/WordPress-Post-Type-Archive-Links/issues/13)
46
+ * Fixes bug where "disabled" is printed if no menu has been created.
47
+ * Tested up to 3.7.1
48
+ * Added German language. Thanks to [@mcguffin](https://github.com/mcguffin).
49
+
50
  = 1.1 =
51
  * Fixed a couple of notices that displayed with debug on
52
  * Better maintainability (avoid touching JS files)