Whitelist iFrame Domains in Pressbooks
- Author: Tom Woodward
- Category: WordPress
- Tags: iframe, pb_whitelisted_domains, pressbooks
add_filter( 'pb_whitelisted_domains', 'pb_add_iframe_srcs'); function pb_add_iframe_srcs ($whitelistedDomains){ array_push($whitelistedDomains,'vcu.kanopy.com'); return $whitelistedDomains; }
PressBooks has a filter that runs in prior to the kses filter and that was removing iframes that we wanted to remain. This bit of PHP in a plugin adds a single domain to the list. If you needed to add a bunch array_merge would let you do that easily.
Related posts
WP JSON to Google Sheets – Reflective Data
Image from page 86 of “Refraction and motility of the eye, with chapters on color blindness and the field of vision” (1920) flickr photo by Internet Archive Book Images shared with no copyright restriction (Flickr Commons) Way back in 2015, I wrote a little pluginand a blog post or I’d never be able to find it to count URLs, get the word count and do other stuff so I could reflect on my blog posts. Given some (k)new knowledgeKickin’ the new k-nowledge . . . an MC to a degree that you can’t get in college, I figured I could make a version that runs in Google Sheets and indeed I can. The reason I like this as an alternative to the plugin is that it works for anyone who has access to Google Sheets even if they can’t install plugins. Google Sheets also offers a lower barrier to messing with your own data once you get start capturing it. You can count the !s, or a variety of emoticons, or how often you use the word “spaces,” or whatever you want- all without the ability to program in php or javascript. I think it starts to open up different doors for studentsand other humans to gather their own kind of data for reflection and amusement. It starts to get […]
- Author: Tom Woodward
- Category: Data, Google, WordPress
- Tags: google scripts, google sheets, json api, rest api
Considering Our WordPress Development Patterns
I believe we’ve developed a pretty solid pattern for making WordPress do what faculty want and making that happen pretty quickly. We have high goals in terms of taking on additional challenging work while also supporting a lot of things and a lot of people so we’ve had to be fairly pragmatic in terms of workflow. There are three types of development we tend to do. I’ll list them below in terms of escalating complexity/time. I’ll explain what plugins and patterns we use to make this work. I know I’ve hashed through this plenty of times before in individual explanations but felt that putting in together in one place might help people, myself included, see the big picture. On the Fly These are changes we can usually make within minutes and often do with the faculty there with us or based on an email request. These types of requests are usually around tweaking themes (hide something or show something extra) or creating simple content-creation workflows for students. These are all things that could be addressed with custom themes/plugins but if they are relatively minimal and unlikely to be replicated by others, we go with what’s already in existence. Theme Tweak Patterns Visuals Since WordPress started allowing custom CSS in the customizer, that’s been a straightforward path for removing things people […]
- Author: Tom Woodward
- Category: Web Development, WordPress
Non-Standard Shapes- Another Odd WP JSON Display
It’s better to see this in the full page view but it grabs a WP JSON feed and makes up non-standard polygon shapes based on the posts using the featured image as the background. Try reloading the page and the shapes will change. If you hover over them they’ll behave in very odd ways as well. That’s all easier to see on the full page view. It’s a strange proof of concept but one I’ll be putting to work for an odd art site in the future. I’ll tame it a bit as I’ve made a number of completely odd decisions just to see what would happen. It could be I’ll end up using data from the posts to influence the shapes more intentionally. That opens up a whole world of strange dataviz possibilities. That is one of the things I love about doing this kind of WordPress interaction. It’s light enough that I’ll run down a path like this and just try it out. I probably wouldn’t have bothered if it required a full child-theme or page template. It’s a low threshold with a high ceiling and now I have another example of something people don’t think WordPress could do for my NMC presentation next week. See the Pen socially engaged artists – jquery by Tom (@twwoodward) on CodePen.
- Author: Tom Woodward
- Category: Data, Examples, WordPress
- Tags: javascript, jquery, WP JSON