An Option for dealing with CORS

As we do more things with JSON, I run into CORS access issues. They can be solved in various ways but it’s often a hassle. It often irritates me as I build demos in COde After wanting a simple solution this AM, I made this tiny, insignificant PHP file that I think might be useful to others. Name this file cors.php.1 Put this file on a server. You can now append some JSON URL to that URL like so … https://yourserver.com/cors.php?url=https://someurl.com/data.json and it returns drama-free JSON for your use and enjoyment. Assuming you have HTTPs on your server it should also deal with HTTP/HTTPS conflicts as well which is very handy at times. 1 Or name it whatever you want. I’m going using bossiness as a shortcut to clarity. […]

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