Version Description
Download this release
Release Info
Developer | simonwheatley |
Plugin | Exclude Pages |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.5
- exclude_pages.php +39 -21
- readme.txt +21 -5
exclude_pages.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Exclude Pages from Navigation
|
4 |
-
Plugin URI: http://
|
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.4
|
7 |
Author: Simon Wheatley
|
|
|
8 |
|
9 |
Copyright 2007 Simon Wheatley
|
10 |
|
@@ -246,7 +247,6 @@ function ep_admin_sidebar_wp25()
|
|
246 |
echo ' </div><!-- #excludepagediv -->';
|
247 |
}
|
248 |
|
249 |
-
|
250 |
// Add some CSS into the HEAD element of the admin area
|
251 |
function ep_admin_css()
|
252 |
{
|
@@ -254,6 +254,8 @@ function ep_admin_css()
|
|
254 |
echo ' div.exclude_alert { font-size: 11px; }';
|
255 |
echo ' .new-admin-wp25 { font-size: 11px; background-color: #fff; }';
|
256 |
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; }';
|
|
|
|
|
257 |
echo ' .new-admin-wp25 div.exclude_alert { padding-top: 5px; }';
|
258 |
echo ' .new-admin-wp25 div.exclude_alert em { font-style: normal; }';
|
259 |
echo ' </style>';
|
@@ -266,29 +268,45 @@ function ep_hec_show_dbx( $to_show )
|
|
266 |
return $to_show;
|
267 |
}
|
268 |
|
269 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
-
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
-
// Set the exclusion when the post is saved
|
276 |
-
add_action('save_post', 'ep_update_exclusions');
|
277 |
|
278 |
-
//
|
279 |
-
|
280 |
-
// the admin side must use another function to get the pages. So we're safe to
|
281 |
-
// remove these pages every time.)
|
282 |
-
add_filter('get_pages','ep_exclude_pages');
|
283 |
|
284 |
-
//
|
285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
|
287 |
-
|
288 |
-
|
289 |
-
// Hide Editor Clutter plugin installed as it's using a custom filter
|
290 |
-
// which won't be called except by the HEC plugin.
|
291 |
-
// Uncomment to show the control by default
|
292 |
-
// add_filter('hec_show_dbx','ep_hec_show_dbx');
|
293 |
|
294 |
?>
|
1 |
<?php
|
2 |
/*
|
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.4
|
7 |
Author: Simon Wheatley
|
8 |
+
Author URI: http://simonwheatley.co.uk/wordpress/
|
9 |
|
10 |
Copyright 2007 Simon Wheatley
|
11 |
|
247 |
echo ' </div><!-- #excludepagediv -->';
|
248 |
}
|
249 |
|
|
|
250 |
// Add some CSS into the HEAD element of the admin area
|
251 |
function ep_admin_css()
|
252 |
{
|
254 |
echo ' div.exclude_alert { font-size: 11px; }';
|
255 |
echo ' .new-admin-wp25 { font-size: 11px; background-color: #fff; }';
|
256 |
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; }';
|
257 |
+
echo ' #ep_admin_meta_box div.inner { padding: inherit; background-color: transparent; border: none; }';
|
258 |
+
echo ' #ep_admin_meta_box div.inner label { background-color: none; }';
|
259 |
echo ' .new-admin-wp25 div.exclude_alert { padding-top: 5px; }';
|
260 |
echo ' .new-admin-wp25 div.exclude_alert em { font-style: normal; }';
|
261 |
echo ' </style>';
|
268 |
return $to_show;
|
269 |
}
|
270 |
|
271 |
+
// INIT FUNCTIONS
|
272 |
+
|
273 |
+
function ep_init()
|
274 |
+
{
|
275 |
+
// Call this function on the get_pages filter
|
276 |
+
// (get_pages filter appears to only be called on the "consumer" side of WP,
|
277 |
+
// the admin side must use another function to get the pages. So we're safe to
|
278 |
+
// remove these pages every time.)
|
279 |
+
add_filter('get_pages','ep_exclude_pages');
|
280 |
+
}
|
281 |
|
282 |
+
function ep_admin_init()
|
283 |
+
{
|
284 |
+
// Add panels into the editing sidebar(s)
|
285 |
+
global $wp_version;
|
286 |
+
if ( version_compare( $wp_version, '2.7-beta', '>=' ) ) {
|
287 |
+
add_meta_box('ep_admin_meta_box', __('Exclude Pages'), 'ep_admin_sidebar_wp25', 'page', 'side', 'low');
|
288 |
+
} else {
|
289 |
+
add_action('dbx_page_sidebar', 'ep_admin_sidebar'); // Pre WP2.5
|
290 |
+
add_action('submitpage_box', 'ep_admin_sidebar_wp25'); // Post WP 2.5, pre WP 2.7
|
291 |
+
}
|
292 |
|
293 |
+
// Set the exclusion when the post is saved
|
294 |
+
add_action('save_post', 'ep_update_exclusions');
|
295 |
|
296 |
+
// Add some CSS to the admin header
|
297 |
+
add_action('admin_head', 'ep_admin_css');
|
|
|
|
|
|
|
298 |
|
299 |
+
// Call this function on our very own hec_show_dbx filter
|
300 |
+
// This filter is harmless to add, even if we don't have the
|
301 |
+
// Hide Editor Clutter plugin installed as it's using a custom filter
|
302 |
+
// which won't be called except by the HEC plugin.
|
303 |
+
// Uncomment to show the control by default
|
304 |
+
// add_filter('hec_show_dbx','ep_hec_show_dbx');
|
305 |
+
}
|
306 |
+
|
307 |
+
// HOOK IT UP TO WORDPRESS
|
308 |
|
309 |
+
add_action( 'init', 'ep_init' );
|
310 |
+
add_action( 'admin_init', 'ep_admin_init' )
|
|
|
|
|
|
|
|
|
311 |
|
312 |
?>
|
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: 2.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
This plugin adds a checkbox, “include this page in menus”, uncheck this to exclude pages from the
|
10 |
page navigation that users see on your site.
|
@@ -16,8 +16,27 @@ page navigation that users see on your site.
|
|
16 |
|
17 |
Any issues: [contact me](http://www.simonwheatley.co.uk/contact-me/).
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
== Change Log ==
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
= v1.4 2008/01/02 =
|
22 |
|
23 |
* ENHANCEMENT: Now compatible with WP 2.5
|
@@ -61,9 +80,6 @@ I'm simply noting requests & bug reports here, I've not necessarily looked into
|
|
61 |
|
62 |
== Screenshots ==
|
63 |
|
64 |
-
There appears to be a [bug](http://wordpress.org/support/topic/167316?replies=1) in this plugin site, which is causing screenshots to
|
65 |
-
not be updated. This may mean there's not a WordPress 2.5 screenshot below.
|
66 |
-
|
67 |
1. WP 2.5 - Showing the control on the editing screen to exclude a page from the navigation
|
68 |
2. WP 2.5 - Showing the control and warning for a page which is the child of an excluded page
|
69 |
3. Pre WP 2.5 - Showing the control on the editing screen to exclude a page from the navigation
|
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: 2.7-beta1
|
7 |
+
Stable tag: 1.5
|
8 |
|
9 |
This plugin adds a checkbox, “include this page in menus”, uncheck this to exclude pages from the
|
10 |
page navigation that users see on your site.
|
16 |
|
17 |
Any issues: [contact me](http://www.simonwheatley.co.uk/contact-me/).
|
18 |
|
19 |
+
=== Incompatible With ===
|
20 |
+
|
21 |
+
These plugins and themes don't use the standard WordPress functions to create it's menu, neither does it pass it's list of pages through the get_pages filter. To get them to work you will need to track down the bit of code in the theme/plugin which gets the pages and change it to apply the filter "get_pages" (I cannot be responsible for any unforseen effects of the changes you make, so please test thoroughly). The change to getting pages will probably look something like this:
|
22 |
+
|
23 |
+
`$pages = apply_filters( 'get_pages', $pages );`
|
24 |
+
|
25 |
+
Please [contact me](http://www.simonwheatley.co.uk/contact-me/) if you're completely stuck and we can discuss possible solutions.
|
26 |
+
|
27 |
+
Exclude pages is incompatible with:
|
28 |
+
|
29 |
+
* [WP CSS Dropdown Menus plugin](http://wordpress.org/extend/plugins/wordpress-css-drop-down-menu/)
|
30 |
+
* [Phantom theme](http://wordpress.org/extend/themes/phantom) - This theme
|
31 |
+
|
32 |
== Change Log ==
|
33 |
|
34 |
+
= v1.5 2008/11/03 =
|
35 |
+
|
36 |
+
* ENHANCEMENT: Now compatible with WP 2.7-beta1
|
37 |
+
* DOCS: Added a list of incompatible plugins
|
38 |
+
* DOCS: Added a list of incompatible themes
|
39 |
+
|
40 |
= v1.4 2008/01/02 =
|
41 |
|
42 |
* ENHANCEMENT: Now compatible with WP 2.5
|
80 |
|
81 |
== Screenshots ==
|
82 |
|
|
|
|
|
|
|
83 |
1. WP 2.5 - Showing the control on the editing screen to exclude a page from the navigation
|
84 |
2. WP 2.5 - Showing the control and warning for a page which is the child of an excluded page
|
85 |
3. Pre WP 2.5 - Showing the control on the editing screen to exclude a page from the navigation
|