In responding to some data requests, I delved into the WP tables to pull some rampages data.
All users ever . . .
I need to set up something more automated but for this I dumped the MySQL tables as CSVs and then just imported them to Google Sheets. With very minimal functions, I got this data.
Sometimes people just want a little bit of WordPress. Before hanging a left with the anth101.com site, we pruned it waaaaay down and tried to make it as simple as possible. This is a pretty solid example that WordPress can be just about anything you want if you’re willing to put in a bit of time and effort. I figure having all these things in one place will help someone else (me most likely) at some point. Hide Posts from Other Authors If you have many authors, you often don’t want them seeing a bunch of posts in the admin area that they can’t edit. Make their lives easier and hide everything else. I believe this is where I found the code. Remove Sidebar Options To further clean up the sidebar for authors, the following code removes lots of things that you don’t want students bothering with anyway. You can get lots of details on this in the codex. Go to Directly to Post, Do Not Pass Dashboard This shunts people directly to the posts area rather than going to the dashboard on login. Posts in Single Column This sets the posts to single column display to simplify writing and was found here. Purify and Rename the Post Page This chunk removes certain meta boxes and restructures the language on […]
There are lots of ways users can end up associated with many sites in a WordPress multisite install. That’s no big deal if it’s only five or ten but sometimes it’s way more. It’s not just messy, it actually degrades performance when you’re logged in because the admin menu bar loads all those sites. This can really become a drag as you pass a hundred or so sites. Previously, I’ve just given up on the user and made a new one. I’ve also gone through https://theSite.us/wp-admin/network/users.php and opened up a number of sites and removed the user from each one manually. That’s a pretty awful pattern but being in a hurry leads to all sorts of bad choices.Proper water bailing form is rarely considered when the boat is barely being kept afloat. Today I got the request to remove around six hundred sites from a particular faculty member. The request coincided with time and mental bandwidth so I opted to do this in an intelligent way. There was also no way I was going to do this by hand. First step would be to get the user’s id from the wp_users table. You can look up users here by user_login or user_email and get to what you need pretty quickly. If you’re using Sequel Pro rather than the terminal don’t […]
I made a little shortcode plugin for making it fairly easy to embed YouTube video snippets. The plugin supports both a start and end time or either a start or end time. It also now allows you to embed multiple videos on a single page. The plugin works like below. Times are in seconds. [yt_video id=”xxxxxxxxx” start=”101″ end=”117″] It’s a slight evolution of the code I found at Amit’s site after a quick Google search. This version obviously ties into WordPress but it also supports multiple videos and stops the video from displaying related videos. The uses for this are pretty wide open. Seems like film studies would have lots of reason to chop up scenes and display them with additional written context.Maybe a loop parameter would be useful . . . Lots of classes would have reasons to chop up YouTube videos to show exactly what they want. Minor Figuring Out of Stuff The only real thing to figure out was how to deal with multiple videos on one page. The original code looked for a single ID on the page. I needed to both generate and find as many unique ideas as people might need. A bit of Google and I found a Stackoverflow bit to create a random string. Then the ID of each div created by […]