By Ed Reckers on January 10, 2012
How to update WordPress user role capabilities using a simple PHP script and WordPress user functions. I came upon this issue recently in which I had full access to a WordPress installation; files, database, etc., but my WordPress user account was originally added as an Editor or some lower role by a client/third party and I really needed to update to an Administrator role. Of course without the original Administrator account I couldn’t update my own role so I needed to create a script to cleanly edit user role/capabilities. Below is a script to change a WordPress user role using the WordPress function wp_update_user:
/*
* Updates user role using WordPress function wp_update_user.
*
* Simple script to be run at webroot. Update user_id and new_role to taste
* and run as regular PHP file on command line.
*
* @package WordPress
*/
require( './wp-load.php' );
// id of user to update
$user_id = 2;
/*
* Basic list of user roles
*
* administrator
* editor
* author
* contributor
* subscriber
*
*/
// user role to update to
$new_role = 'administrator';
// update user role using wordpress function
wp_update_user( array ('ID' => $user_id, 'role' => $new_role ) ) ;
You can take this and save it out as a file called manually-update-role.php or whatever you like. Open the file and update user_id and new_role and then run. Check that it ran successfully (the user role should of course be changed) and remove file. Run the file like so:
php manually-update-role.php
There are a couple pages on the web which I used as a resource:
The first 2 links above approach the problem in different ways. The first link; an answer from Stack Exchange updates the user object (and doesn’t include how to create a script for the code mentioned) and the 2nd link at Shine PHP has you editing the database directly, which in my case I could have easily done, but just seems a little messy and could really lead to some problems if fat-fingered. The Shine PHP site seems to be the same people that created and maintain the plugin
User Role Editor which is nice but overpowered for this particular use case. There’s really only about 2 resources that are easily searchable to help you edit user role capabilities in WordPress. I’ve added a script to that.
Posted in WordPress | Tagged bay area wordpress consultant, bay area wordpress developer, bay area wordpress development, bay area wordpress expert, san francisco wordpress consultant, san francisco wordpress developer, san francisco wordpress expert, scripts, wordpress, wordpress consultant, wordpress consultant san francisco, wordpress developer, wordpress expert, wordpress expert san francisco, wordpress plugin developer, wordpress plugins |
By Ed Reckers on January 6, 2012
Squishy is a Responsive WordPress Theme based on Theme Hybrid, Hybrid Core and 1140 CSS Grid. This is a Parent Theme used by Red Bridge Internet for quick deploy of Responsive WordPress Themes and projects.
Squishy is hosted on BitBucket:
It’s in active development and will be for a month or so.
Posted in Themes | Tagged html5, responsive, San Francisco web site development, san francisco wordpress consultant, san francisco wordpress plugin developers, san francisco wordpress theme designer, san francisco wordpress theme developer, themes, wordpress, wordpress consultant san francisco, wordpress developers san francisco, wordpress theme |
By Ed Reckers on January 2, 2012
There is a wonderful presentation called, “What the Heck is Responsive Web Design” by John Polacek on his Github using scrolldeck.js:
Definitely check out
scrolldeck.js used to create the slide deck still presenation.
Posted in Blogging | Tagged html5, javascript, responsive, responsive design |
By Ed Reckers on October 10, 2011
If you need to list the number and names of sites hosted on a single shared host (by IP address) you can use the following two services:
Alternatively, you can follow these steps:
Alternatively, Bing can return a list of domains sitting on a single IP:
That’s it. There’s a couple methods you can try when looking for the domains sharing a single host and ip address on a shared server.
Posted in How To |