- function get_users_with_role ($role) {
- // gets all users with specified role
- $wp_user_search = new WP_User_Search( '', '', $role);
- return $wp_user_search->get_results();
- }
As John notes, remember this is for use in the admin panels. Thanks, John.
Mon 16 Mar 2009
Posted by Charles Clarkson under PHP, Programming, WordPress
No Comments
Sun 9 Nov 2008
Posted by Charles Clarkson under PHP, Programming, WordPress
No Comments
Fri 18 Apr 2008
Posted by Charles Clarkson under PHP, Programming
No Comments
I ran across this piece of code in a program I am updating. The original author is a great game designer, but only a fair programmer. He also seems to have very limited experience with SQL.
When writing database applications, you need to be as good at writing queries as you are at writing code. Here's a rewrite:
(more...)Tue 18 Mar 2008
Posted by Charles Clarkson under PHP, Perl, Programming
No Comments
I guess this is more a reminder to myself than useful information, but here goes.
Recently, I read up on PHP 5.x header() function. I ran across this tidbit of info.
HTTP/1.1 requires an absolute URI as argument to ยป Location: including the scheme, hostname and absolute path, but some clients accept relative URIs.
I don't know about you, but I find
Following this standard eliminates another problem in a different language. In Perl, many people correctly use CGI.pm to perform redirects. The CGI manual gives the same advice. Use full URLs to redirect.
Here's a mini guide to redirection: (Basically, you just print the redirect out.)
(more...)