Exclude Pages - Version 1.9

Version Description

Download this release

Release Info

Developer simonwheatley
Plugin Icon wp plugin Exclude Pages
Version 1.9
Comparing to
See all releases

Code changes from version 1.8.3 to 1.9

exclude_pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Exclude Pages from Navigation
4
  Plugin URI: http://wordpress.org/extend/plugins/exclude-pages/
5
  Description: Provides a checkbox on the editing page which you can check to exclude pages from the primary navigation. IMPORTANT NOTE: This will remove the pages from any "consumer" side page listings, which may not be limited to your page navigation listings.
6
- Version: 1.8.3
7
  Author: Simon Wheatley
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
 
@@ -216,7 +216,7 @@ function ep_admin_sidebar_wp25() {
216
  $nearest_excluded_ancestor = ep_nearest_excluded_ancestor();
217
  echo ' <div id="excludepagediv" class="new-admin-wp25">';
218
  echo ' <div class="outer"><div class="inner">';
219
- echo ' <label for="ep_this_page_included" class="selectit">';
220
  echo ' <input ';
221
  echo ' type="checkbox" ';
222
  echo ' name="ep_this_page_included" ';
@@ -224,17 +224,54 @@ function ep_admin_sidebar_wp25() {
224
  if ( ep_this_page_included() )
225
  echo 'checked="checked"';
226
  echo ' />';
227
- echo ' '.__( 'Include this page in user menus', EP_TD ).'</label>';
228
- echo ' <input type="hidden" name="ep_ctrl_present" value="1" />';
229
  if ( $nearest_excluded_ancestor !== false ) {
230
- echo '<div class="exclude_alert"><em>';
231
- echo sprintf( __( 'N.B. An ancestor of this page is excluded, so this page is too (<a href="%1$s" title="%2$s">edit ancestor</a>).', EP_TD), "post.php?action=edit&amp;post=$nearest_excluded_ancestor", __( 'edit the excluded ancestor', EP_TD ) );
232
- echo '</em></div>';
233
  }
234
- echo ' </div><!-- .inner --></div><!-- .outer -->';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  echo ' </div><!-- #excludepagediv -->';
236
  }
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  /**
239
  * Hooks the WordPress admin_head action to inject some CSS.
240
  *
@@ -242,15 +279,37 @@ function ep_admin_sidebar_wp25() {
242
  * @author Simon Wheatley
243
  **/
244
  function ep_admin_css() {
245
- echo ' <style type="text/css" media="screen">';
246
- echo ' div.exclude_alert { font-size: 11px; }';
247
- echo ' .new-admin-wp25 { font-size: 11px; background-color: #fff; }';
248
- echo ' .new-admin-wp25 div.inner { padding: 8px 12px; background-color: #EAF3FA; border: 1px solid #EAF3FA; -moz-border-radius: 3px; -khtml-border-bottom-radius: 3px; -webkit-border-bottom-radius: 3px; border-bottom-radius: 3px; }';
249
- echo ' #ep_admin_meta_box div.inner { padding: inherit; background-color: transparent; border: none; }';
250
- echo ' #ep_admin_meta_box div.inner label { background-color: none; }';
251
- echo ' .new-admin-wp25 div.exclude_alert { padding-top: 5px; }';
252
- echo ' .new-admin-wp25 div.exclude_alert em { font-style: normal; }';
253
- echo ' </style>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  }
255
 
256
  // Add our ctrl to the list of controls which AREN'T hidden
@@ -292,8 +351,9 @@ function ep_admin_init() {
292
  // Set the exclusion when the post is saved
293
  add_action('save_post', 'ep_update_exclusions');
294
 
295
- // Add some CSS to the admin header
296
  add_action('admin_head', 'ep_admin_css');
 
297
 
298
  // Call this function on our very own hec_show_dbx filter
299
  // This filter is harmless to add, even if we don't have the
3
  Plugin Name: Exclude Pages from Navigation
4
  Plugin URI: http://wordpress.org/extend/plugins/exclude-pages/
5
  Description: Provides a checkbox on the editing page which you can check to exclude pages from the primary navigation. IMPORTANT NOTE: This will remove the pages from any "consumer" side page listings, which may not be limited to your page navigation listings.
6
+ Version: 1.9
7
  Author: Simon Wheatley
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
 
216
  $nearest_excluded_ancestor = ep_nearest_excluded_ancestor();
217
  echo ' <div id="excludepagediv" class="new-admin-wp25">';
218
  echo ' <div class="outer"><div class="inner">';
219
+ echo ' <p><label for="ep_this_page_included" class="selectit">';
220
  echo ' <input ';
221
  echo ' type="checkbox" ';
222
  echo ' name="ep_this_page_included" ';
224
  if ( ep_this_page_included() )
225
  echo 'checked="checked"';
226
  echo ' />';
227
+ echo ' '.__( 'Include this page in lists of pages', EP_TD ).'</label>';
228
+ echo ' <input type="hidden" name="ep_ctrl_present" value="1" /></p>';
229
  if ( $nearest_excluded_ancestor !== false ) {
230
+ echo '<p class="ep_exclude_alert"><em>';
231
+ printf( __( 'N.B. An ancestor of this page is excluded, so this page is too (<a href="%1$s" title="%2$s">edit ancestor</a>).', EP_TD), "post.php?action=edit&amp;post=$nearest_excluded_ancestor", __( 'edit the excluded ancestor', EP_TD ) );
232
+ echo '</em></p>';
233
  }
234
+ // If there are custom menus (WP 3.0+) then we need to clear up some
235
+ // potential confusion here.
236
+ if ( ep_has_menu() ) {
237
+ echo '<p id="ep_custom_menu_alert"><em>';
238
+ if ( current_user_can( 'edit_theme_options' ) )
239
+ printf( __( 'N.B. This page can still appear in explicitly created <a href="%1$s">menus</a> (<a id="ep_toggle_more" href="#ep_explain_more">explain more</a>)', EP_TD),
240
+ "nav-menus.php" );
241
+ else
242
+ _e( 'N.B. This page can still appear in explicitly created menus (<a id="ep_toggle_more" href="#ep_explain_more">explain more</a>)', EP_TD);
243
+ echo '</em></p>';
244
+ echo '<div id="ep_explain_more"><p>';
245
+ if ( current_user_can( 'edit_theme_options' ) )
246
+ printf( __( 'WordPress provides a simple function for you to maintain your site <a href="%1$s">menus</a>. If you create a menu which includes this page, the checkbox above will not have any effect on the visibility of that menu item.', EP_TD),
247
+ "nav-menus.php" );
248
+ else
249
+ _e( 'WordPress provides a simple function for you to maintain the site menus, which your site administrator is using. If a menu includes this page, the checkbox above will not have any effect on the visibility of that menu item.', EP_TD);
250
+ echo '</p><p>';
251
+ echo _e( 'If you think you no longer need the Exclude Pages plugin you should talk to your WordPress administrator about disabling it.', EP_TD );
252
+ echo '</p></div>';
253
+ }
254
+ echo ' </div><!-- .inner --></div><!-- .outer -->';
255
  echo ' </div><!-- #excludepagediv -->';
256
  }
257
 
258
+ /**
259
+ * A conditional function to determine whether there are any menus
260
+ * defined in this WordPress installation.
261
+ *
262
+ * @return bool Indicates the presence or absence of menus
263
+ * @author Simon Wheatley
264
+ **/
265
+ function ep_has_menu() {
266
+ if ( ! function_exists( 'wp_get_nav_menus' ) )
267
+ return false;
268
+ $menus = wp_get_nav_menus();
269
+ foreach ( $menus as $menu_maybe ) {
270
+ if ( $menu_items = wp_get_nav_menu_items($menu_maybe->term_id) )
271
+ return true;
272
+ }
273
+ }
274
+
275
  /**
276
  * Hooks the WordPress admin_head action to inject some CSS.
277
  *
279
  * @author Simon Wheatley
280
  **/
281
  function ep_admin_css() {
282
+ echo <<<END
283
+ <style type="text/css" media="screen">
284
+ .ep_exclude_alert { font-size: 11px; }
285
+ .new-admin-wp25 { font-size: 11px; background-color: #fff; }
286
+ .new-admin-wp25 .inner { padding: 8px 12px; background-color: #EAF3FA; border: 1px solid #EAF3FA; -moz-border-radius: 3px; -khtml-border-bottom-radius: 3px; -webkit-border-bottom-radius: 3px; border-bottom-radius: 3px; }
287
+ #ep_admin_meta_box .inner { padding: inherit; background-color: transparent; border: none; }
288
+ #ep_admin_meta_box .inner label { background-color: none; }
289
+ .new-admin-wp25 .exclude_alert { padding-top: 5px; }
290
+ .new-admin-wp25 .exclude_alert em { font-style: normal; }
291
+ </style>
292
+ END;
293
+ }
294
+
295
+ /**
296
+ * Hooks the WordPress admin_head action to inject some JS.
297
+ *
298
+ * @return void
299
+ * @author Simon Wheatley
300
+ **/
301
+ function ep_admin_js() {
302
+ echo <<<END
303
+ <script type="text/javascript">
304
+ //<![CDATA[
305
+ jQuery( '#ep_explain_more' ).hide();
306
+ jQuery( '#ep_toggle_more' ).click( function() {
307
+ jQuery( '#ep_explain_more' ).toggle();
308
+ return false;
309
+ } );
310
+ //]]>
311
+ </script>
312
+ END;
313
  }
314
 
315
  // Add our ctrl to the list of controls which AREN'T hidden
351
  // Set the exclusion when the post is saved
352
  add_action('save_post', 'ep_update_exclusions');
353
 
354
+ // Add the JS & CSS to the admin header
355
  add_action('admin_head', 'ep_admin_css');
356
+ add_action('admin_footer', 'ep_admin_js');
357
 
358
  // Call this function on our very own hec_show_dbx filter
359
  // This filter is harmless to add, even if we don't have the
locale/exclude-pages-it_IT.mo ADDED
Binary file
locale/exclude-pages-it_IT.po ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translation of the WordPress plugin by .
2
+ # Copyright (C) 2010
3
+ # This file is distributed under the same license as the package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: Exclude Pages in italiano\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/exclude-pages\n"
10
+ "POT-Creation-Date: 2010-06-16 17:15+0000\n"
11
+ "PO-Revision-Date: 2010-06-17 17:55+0100\n"
12
+ "Last-Translator: Gianni Diurno (aka gidibao) <gidibao[at]gmail[dot]com>\n"
13
+ "Language-Team: Gianni Diurno | gidibao.net <gidibao[at]gmail[dot]com>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Poedit-Language: Italian\n"
18
+ "X-Poedit-Country: ITALY\n"
19
+
20
+ #: exclude_pages.php:198
21
+ msgid "Comma separated list of post and page IDs to exclude when returning pages from the get_pages function."
22
+ msgstr "Separa con una virgola la lista delle ID (articoli e pagine) in modo tale che vengano escluse dalla funzione get_pages."
23
+
24
+ #: exclude_pages.php:227
25
+ msgid "Include this page in lists of pages"
26
+ msgstr "Includi questa pagina nella lista delle pagine"
27
+
28
+ #: exclude_pages.php:231
29
+ #, php-format
30
+ msgid "N.B. An ancestor of this page is excluded, so this page is too (<a href=\"%1$s\" title=\"%2$s\">edit ancestor</a>)."
31
+ msgstr "N.B. La pagina madre é stata esclusa, così come questa (<a href=\"%1$s\" title=\"%2$s\">modifica</a>)."
32
+
33
+ #: exclude_pages.php:231
34
+ msgid "edit the excluded ancestor"
35
+ msgstr "modifica la pagina madre esclusa"
36
+
37
+ #: exclude_pages.php:239
38
+ #, php-format
39
+ msgid "N.B. This page can still appear in explicitly created <a href=\"%1$s\">menus</a> (<a id=\"ep_toggle_more\" href=\"#ep_explain_more\">explain more</a>)"
40
+ msgstr "N.B. Questa pagina potrebbe ancora apparire in quei <a href=\"%1$s\">menu</a> espressamente creati (<a id=\"ep_toggle_more\" href=\"#ep_explain_more\">ulteriori informazioni</a>)"
41
+
42
+ #: exclude_pages.php:242
43
+ msgid "N.B. This page can still appear in explicitly created menus (<a id=\"ep_toggle_more\" href=\"#ep_explain_more\">explain more</a>)"
44
+ msgstr "N.B. Questa pagina potrebbe ancora apparire in quei menu espressamente creati (<a id=\"ep_toggle_more\" href=\"#ep_explain_more\">ulteriori informazioni</a>)"
45
+
46
+ #: exclude_pages.php:246
47
+ #, php-format
48
+ msgid "WordPress provides a simple function for you to maintain your site <a href=\"%1$s\">menus</a>. If you create a menu which includes this page, the checkbox above will not have any effect on the visibility of that menu item."
49
+ msgstr "WordPress fornisce una semplice funzione per il mantenemento dei <a href=\"%1$s\">menu</a> del tuo sito. Nel caso in cui avesi creato un menu menu nel quale fosse stata inclusa questa pagina, la casella di selezione qui sopra non avrà alcun effetto sulla visibilità di quel dato termine presente nel menu."
50
+
51
+ #: exclude_pages.php:249
52
+ msgid "WordPress provides a simple function for you to maintain the site menus, which your site administrator is using. If a menu includes this page, the checkbox above will not have any effect on the visibility of that menu item."
53
+ msgstr "WordPress fornisce una semplice funzione per il mantenemento dei menu del tuo sito. Nel caso in cui avesi creato un menu menu nel quale fosse stata inclusa questa pagina, la casella di selezione qui sopra non avrà alcun effetto sulla visibilità di quel dato termine presente nel menu."
54
+
55
+ #: exclude_pages.php:251
56
+ msgid "If you think you no longer need the Exclude Pages plugin you should talk to your WordPress administrator about disabling it."
57
+ msgstr "Qualora decidessi di non utilizzare più Exclude Pages, sarà sufficiente disattivare il plugin."
58
+
59
+ #: exclude_pages.php:349
60
+ msgid "Exclude Pages"
61
+ msgstr "Escludi pagine"
62
+
locale/exclude-pages.pot CHANGED
@@ -8,35 +8,70 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: \n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/exclude-pages\n"
11
- "POT-Creation-Date: 2010-05-14 08:36+0000\n"
12
  "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: Simon Wheatley <simon@simonwheatley.co.uk>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "MIME-Version: 1.0\n"
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
- #: exclude_pages.php:196
20
  msgid ""
21
  "Comma separated list of post and page IDs to exclude when returning pages "
22
  "from the get_pages function."
23
  msgstr ""
24
 
25
- #: exclude_pages.php:226
26
- msgid "Include this page in user menus"
27
  msgstr ""
28
 
29
- #: exclude_pages.php:230
30
  #, php-format
31
  msgid ""
32
  "N.B. An ancestor of this page is excluded, so this page is too (<a href=\"%1"
33
  "$s\" title=\"%2$s\">edit ancestor</a>)."
34
  msgstr ""
35
 
36
- #: exclude_pages.php:230
37
  msgid "edit the excluded ancestor"
38
  msgstr ""
39
 
40
- #: exclude_pages.php:284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  msgid "Exclude Pages"
42
  msgstr ""
8
  msgstr ""
9
  "Project-Id-Version: \n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/exclude-pages\n"
11
+ "POT-Creation-Date: 2010-06-16 17:15+0000\n"
12
  "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "MIME-Version: 1.0\n"
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
+ #: exclude_pages.php:198
20
  msgid ""
21
  "Comma separated list of post and page IDs to exclude when returning pages "
22
  "from the get_pages function."
23
  msgstr ""
24
 
25
+ #: exclude_pages.php:227
26
+ msgid "Include this page in lists of pages"
27
  msgstr ""
28
 
29
+ #: exclude_pages.php:231
30
  #, php-format
31
  msgid ""
32
  "N.B. An ancestor of this page is excluded, so this page is too (<a href=\"%1"
33
  "$s\" title=\"%2$s\">edit ancestor</a>)."
34
  msgstr ""
35
 
36
+ #: exclude_pages.php:231
37
  msgid "edit the excluded ancestor"
38
  msgstr ""
39
 
40
+ #: exclude_pages.php:239
41
+ #, php-format
42
+ msgid ""
43
+ "N.B. This page can still appear in explicitly created <a href=\"%1$s"
44
+ "\">menus</a> (<a id=\"ep_toggle_more\" href=\"#ep_explain_more\">explain "
45
+ "more</a>)"
46
+ msgstr ""
47
+
48
+ #: exclude_pages.php:242
49
+ msgid ""
50
+ "N.B. This page can still appear in explicitly created menus (<a id="
51
+ "\"ep_toggle_more\" href=\"#ep_explain_more\">explain more</a>)"
52
+ msgstr ""
53
+
54
+ #: exclude_pages.php:246
55
+ #, php-format
56
+ msgid ""
57
+ "WordPress provides a simple function for you to maintain your site <a href="
58
+ "\"%1$s\">menus</a>. If you create a menu which includes this page, the "
59
+ "checkbox above will not have any effect on the visibility of that menu item."
60
+ msgstr ""
61
+
62
+ #: exclude_pages.php:249
63
+ msgid ""
64
+ "WordPress provides a simple function for you to maintain the site menus, "
65
+ "which your site administrator is using. If a menu includes this page, the "
66
+ "checkbox above will not have any effect on the visibility of that menu item."
67
+ msgstr ""
68
+
69
+ #: exclude_pages.php:251
70
+ msgid ""
71
+ "If you think you no longer need the Exclude Pages plugin you should talk to "
72
+ "your WordPress administrator about disabling it."
73
+ msgstr ""
74
+
75
+ #: exclude_pages.php:349
76
  msgid "Exclude Pages"
77
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: simonwheatley
3
  Donate link: http://www.simonwheatley.co.uk/wordpress-plugins/
4
  Tags: get_pages, navigation, menu, exclude pages, hide pages
5
  Requires at least: 2.2.3
6
- Tested up to: 3.0 beta
7
- Stable tag: 1.8.3
8
 
9
  This plugin adds a checkbox, “include this page in menus”, uncheck this to exclude pages from the page navigation that users see on your site.
10
 
@@ -22,6 +22,8 @@ It is possible to temporarily pause and resume the effect of Exclude Pages by us
22
  <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
23
  <?php resume_exclude_pages(); ?>`
24
 
 
 
25
  Note to other plugin authors:
26
 
27
  The plugin does not operate on wp_list_pages while the user is on an admin page, if this is an issue you can take advantage of the `ep_admin_bail_out` filter and create a filter function which returns false to allow Exclude Pages to operate in the admin area.
@@ -41,6 +43,15 @@ Exclude pages is incompatible with:
41
 
42
  == Change Log ==
43
 
 
 
 
 
 
 
 
 
 
44
  = v1.8.3 2010/5/20 =
45
 
46
  * LOCALISATION: Polish translation courtesy of [Pawel, Siedlecki Portal Informacyjnie Najlepszy](http://www.spin.siedlce.pl)
3
  Donate link: http://www.simonwheatley.co.uk/wordpress-plugins/
4
  Tags: get_pages, navigation, menu, exclude pages, hide pages
5
  Requires at least: 2.2.3
6
+ Tested up to: 3.0
7
+ Stable tag: 1.9
8
 
9
  This plugin adds a checkbox, “include this page in menus”, uncheck this to exclude pages from the page navigation that users see on your site.
10
 
22
  <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
23
  <?php resume_exclude_pages(); ?>`
24
 
25
+ You can also get an array the IDs of the pages which are excluded by calling the function `ep_get_excluded_ids();`, you can then use these IDs as you wish (e.g. feed them into raw MySQL queries).
26
+
27
  Note to other plugin authors:
28
 
29
  The plugin does not operate on wp_list_pages while the user is on an admin page, if this is an issue you can take advantage of the `ep_admin_bail_out` filter and create a filter function which returns false to allow Exclude Pages to operate in the admin area.
43
 
44
  == Change Log ==
45
 
46
+ = v1.9 2010/6/16 =
47
+
48
+ * Tested with WP 3.0 rc3
49
+ * ENHANCEMENT: Detects the use of WP menus and advises the user accordingly
50
+
51
+ = v1.8.4 2010/5/21 =
52
+
53
+ * LOCALISATION: Italian translation courtesy of [Gianni Diurno](http://gidibao.net/index.php/portfolio/)
54
+
55
  = v1.8.3 2010/5/20 =
56
 
57
  * LOCALISATION: Polish translation courtesy of [Pawel, Siedlecki Portal Informacyjnie Najlepszy](http://www.spin.siedlce.pl)