[wp-hackers] add_meta_box without checked?

Frank Bueltge frank at bueltge.de
Fri May 1 22:11:36 GMT 2009


Thanks John,
I think get_users_of_blog() is little bid bogger, more datas and my sql is
faster for this. I will only the ID.

Thanks a lot for your time and help!

Best regards
Frank

__
Das Buch: WordPress - Weblogs einrichten und administrieren, Open Source
Press
 ISBN 978-3-937514-33-8
 http://wordpress-buch.bueltge.de/das-buch/

http://bueltge.de : frank at bueltge.de
http://wpengineer.com : frank at wpengineer.com
__
Frank Bültge
Tel:    +49 3691 212951
Mobil:  +49 170 5322053
E-Mail: f.bueltge at inpsyde.com

Inpsyde GmbH
Mutzer Heide 3
51467 Bergisch Gladbach

Steuernr: 204/5756/0999 Steueridentnr.: DE263849534
Geschäftsführender Gesellschafter: H. Rohé HRB 65224 Amtsgericht Köln

http://inpsyde.com
http://pressthis.de


On Fri, May 1, 2009 at 11:44 PM, John Blackbourn
<johnbillion+wp at gmail.com<johnbillion%2Bwp at gmail.com>
> wrote:

> Looks good Frank. You could also use get_users_of_blog() instead of
> your SQL query.
>
> John.
>
> 2009/5/1 Frank Bueltge <frank at bueltge.de>:
> > @John and scribu:
> > i have no found a other solution as set the user_meta_dat for this. I
> have
> > write a small function to write the usermeta on activate the plugin.
> Please
> > -waht do you think about this?
> >
> > register_activation_hook( __FILE__, array(&$this, 'install') );
> >        function install() {
> >            global $wpdb;
> >
> >            $wp_users = $wpdb->get_results(
> >
> > $wpdb->prepare(
> >
> >                "SELECT ID
> >
> >                 FROM   $wpdb->users
> >
> >                 ORDER  BY ID"
> >
> >                )
> >                                                                );
> >
> >            $hidden_page = array();
> >            $hidden_post = array();
> >            $hidden_page = get_hidden_meta_boxes('page');
> >            $hidden_post = get_hidden_meta_boxes('post');
> >            array_push( $hidden_page, 'mygermancityfacts' );
> >            array_push( $hidden_post, 'mygermancityfacts' );
> >            foreach ( $wp_users as $user ) {
> >                $userID = (int) $user->ID;
> >                update_usermeta( $userID, 'metaboxhidden_page',
> $hidden_page
> > );
> >                update_usermeta( $userID, 'metaboxhidden_post',
> $hidden_post
> > );
> >            }
> >        }
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list