Simple Content Restrictor Plugin

Origin Story I had a number of emails from people trying to restrict content in various ways. One person wanted to restrict access because they were editing previously published content. Another person wanted more of a traditional membership-style option with the ability to restrict certain content based on user roles. I looked at some of the plugins out there but felt that building something a little less corporate1 would be pretty easy. It’ll likely evolve as I get some people using it but it’s here now if you want to mess with it. Making It This plugin uses the Advanced Custom Fields plugin as it saves me tons of hassle building custom field interfaces. ACF Stuff First, these two pieces enable me to sync up ACF field data without the drama of import/export or hard coding it into PHP.2 Now, I started off hand-writing the user levels as items. While easy, it felt wrong because there might be other user levels created by other plugins and they’d end up left out. I realized I could just add the user roles automatically like so. This will list all the user roles on the site as options. Filtering the Content My original idea was that I could just use use WP’s content filter. That is what I did but things got more […] […]

Read More…

Simple Content Restrictor Plugin

Origin Story I had a number of emails from people trying to restrict content in various ways. One person wanted to restrict access because they were editing previously published content. Another person wanted more of a traditional membership-style option with the ability to restrict certain content based on user roles. I looked at some of the plugins out there but felt that building something a little less corporate1 would be pretty easy. It’ll likely evolve as I get some people using it but it’s here now if you want to mess with it. Making It This plugin uses the Advanced Custom Fields plugin as it saves me tons of hassle building custom field interfaces. ACF Stuff First, these two pieces enable me to sync up ACF field data without the drama of import/export or hard coding it into PHP.2 Now, I started off hand-writing the user levels as items. While easy, it felt wrong because there might be other user levels created by other plugins and they’d end up left out. I realized I could just add the user roles automatically like so. This will list all the user roles on the site as options. Filtering the Content My original idea was that I could just use use WP’s content filter. That is what I did but things got more […] […]

Read More…

WPlus WordPress Theme

Origin Story There once was a group who really liked Google Plus. With the demise of the service, they were unhappy. With this request, I wondered if we might just build a very similar experience in WordPress. I think I ended up getting pretty close. The Look The theme is built using our normal pattern of bending Understrap so it uses Bootstrap at its core. The theme is here. I don’t know if this works decently or not (vertical slider gets kind of lost) but I took a shot at making the WordPress theme comparable to the Google Plus layout using juxtapose. If you’re anything like me, you have no real memory of what Google Plus looked like and I want you to appreciate this. Luckily I still have access to G+ through my VCU account for at least a while longer. The Masonry Grid I didn’t think too hard when I opted to make the initial masonry layout.1 I used what seemed like a really handy path. What I didn’t pay attention to was that this particular masonry-sort goes top to bottom and then left to right. Since that was brought to my attention, I’ve gone back to the G+ layout and tried to see more logic behind how they did it and what the sort order is but […] […]

Read More…

Sliders as Inputs

Warning: Cannot modify header information – headers already sent by (output started at /home/bionicte/public_html/wp-includes/feed-rss2.php:11) in /home/bionicte/public_html/wp-content/plugins/danger_mouse.php on line 35
Origin Story There once was a worksheet that was meant to be used in a face-to-face scenario. The goal was indicate where you fell on a spectrum across a number cultural orientation of measures. The challenge was to transform that into something digital that could then be part of a larger conversations. Watch the video above to get an idea of what the experience is like or this will make even less sense. The Sliders I like sliders as interface elements for things like these.1 You can see the HTML below that builds them or check out the Codepen for more CSS etc. That’s all pretty straight forward. I did have to add the input tag to the KSES allowed list to keep WordPress from stripping it out. To do that I added the following to our KSES modifier file. Getting the Values Now I needed some javascript to look at these sliders and record the values as the sliders were . . . slid in various directions. This little bit gets our values once we loop through the sliders that exist. Simple. Gravity Forms Integration I did this via Gravity Forms because it’s fast and I’m overly comfortable with it. This is where things get a bit weird. We’re using a typical Gravity Forms to post scenario. Nothing odd […] […]

Read More…

Filter WordPress Title but Only in Admin Area

Warning: Cannot modify header information – headers already sent by (output started at /home/bionicte/public_html/wp-includes/feed-rss2.php:11) in /home/bionicte/public_html/wp-content/plugins/danger_mouse.php on line 35
I am playing around with unfurling1 open graph data in the WordPress TinyMCE editor. You can see what that looks like in the video above. It’s a lot like the oEmbed experience in WordPress but with the open graph information driving it. I want the data to go into the post body but I don’t want a title that links to a post because these types of posts are more about getting people out to that original content. People could still manually enter a title and that’d work but if they choose not to I thought it’d be nice if it was just removed from the equation. That’s pretty nice on the front end but on the backend you end up with a maze of posts with the title (no title). That seemed irritating so I cobbled together the following function which creates a mini excerpt from the post content but only applies the filter when you’re in the backend/dashboard. Nothing fancy but a nice little pattern that I expect I’ll use again. via GIPHY 1 I like how furl and url have similar sounds but it is a ridiculous term. […]

Read More…

Privacy Statement