2013-05-24, 15:26:44
(2013-05-21, 06:34:21)Angryboy Wrote: Assuming that this is more of an aesthetic issue than security, here's a quick solution that you can use to hide any page in the Pages tab using CSS:
Code:$hidePages = array('gallery');
add_action('header', 'hidePagesOnPages', array($slugs=$hidePages));
function hidePagesOnPages($slugs) {
echo '<style type="text/css">';
foreach ($slugs as $slug) echo 'tr#tr-'.$slug.' { display: none; }';
echo' </style>';
}
Add that code into any plugin of your choice and append the $hidePages array with any other page slugs that you wish and they will be hidden from the client.
Hi Angryboy,
First of all: Great to have you back on the forums, you've been missed! Hope your studies are going well
Also great to see you're migrating your site to a new url, hope you have it filled soon (as the other url is giving a 403 right now), your documentation is of great help to many GS users.
With regards to your quick solution, it was indeed just an aesthetic issue. Showing 'gallery' in the pages tab without the user basically being able to do anything with it will potentially put them on the wrong footing. So this is a great solution and it works like a charm.
Only 'problem' is that plugins have the tendency to be updated quite often so that would mean having to drop in the code on a regular basis. So I have included it in the anonymous_data plugin for now, that one basically just sits there.
Thanks for your help in any case!