[wp-hackers] Re: screen_meta and 2.7beta3

andré renaut andre.renaut at gmail.com
Wed Nov 19 07:21:49 GMT 2008


Oops did it already, discard my last message. Thanks

2008/11/18 andré renaut <andre.renaut at gmail.com>

> Hi,
>
> i am still struggling to add the screen options to my plugin pages.
>
> So i manage to get the $page_hook everywhere i needed it. even in
> javascript to post to admin-ajax the right values but ....
>
>
> the $page_hook is that type : toto_page_xyz
>
> and in admin-ajax.php there is this :
>
> case 'closed-postboxes' :
>     check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );
>     $closed = isset( $_POST['closed'] )? $_POST['closed'] : '';
>     $closed = explode( ',', $_POST['closed'] );
>     $hidden = isset( $_POST['hidden'] )? $_POST['hidden'] : '';
>     $hidden = explode( ',', $_POST['hidden'] );
>     $page = isset( $_POST['page'] )? $_POST['page'] : '';
> *    if ( !preg_match( '/^[a-z-]+$/', $page ) ) {
>         die(-1);
>     }*
>     $current_user = wp_get_current_user();
>     if ( is_array($closed) )
>         update_usermeta($current_user->ID, 'closedpostboxes_'.$page,
> $closed);
>     if ( is_array($hidden) )
>         update_usermeta($current_user->ID, 'meta-box-hidden_'.$page,
> $hidden);
> break;
>
> so no chance to have my indivudual settings for a metabox or a column to be
> saved ...
>
> any ideas ?
>
>


-- 
Pensez à l'environnement avant d'imprimer ce message.
Please, think about the environment before printing this message.


More information about the wp-hackers mailing list