[wp-hackers] Hide pages from panels

Mike Little wordpress at zed1.com
Thu Oct 11 08:59:24 UTC 2012

On 10 October 2012 20:03, Diana K. C <dianakac at gmail.com> wrote:

> Hi Mike,
> I like this plugin, but I need to hide pages in panels, those are indeed
> static pages that would never change again, sort of a historic content.
> I have this code, but as I said, I need to pass IDs and also doesn't hide
> them in dropdown :(
> add_action( 'pre_get_posts' ,'hide_pages_87ff65f5f' );function
> hide_pages_87ff65f5f( $query ) {    if( !is_admin() )        return $query;
> global $currentpage;  $pages = array('2389','2605','2640','**2970','2626');
> if( 'edit.php' == $currentpage && ( get_query_var('post_type') && 'page' ==
> get_query_var('post_type') ) )    $query->set( 'post__not_in', $pages );
> return $query;}
I'm not clear which 'panels' you mean.

Another thing to consider, the code you pasted looks like it will hide
those pages from almost everywhere in the admin screens; how will you ever
get to them to edit them (even if rarely)?

It sounds like you need to specify:
* exactly which 'panels' you want these pages hidden from,
* exactly which drop down lists you want them hidden from
* how you want to specify those pages (all pages created in a certain
month, before a certain date, children of a specific page?),
* and how you will be able to get at them to edit or manage the hidden ones.

And then get someone to write some custom code for you.

Mike Little

More information about the wp-hackers mailing list