Skip to content

Instantly share code, notes, and snippets.

@JelmerIJff
JelmerIJff / shortIfWithoutElse.php
Last active June 8, 2021 12:09
Fire function without the else.
<?php
(!isset($var['data']) ?: $this->function();
@JelmerIJff
JelmerIJff / WordPressInstagramFacebookEmbed.php
Last active December 24, 2020 10:29
This class adds the Instagram & Facebook embeds back into WordPress. For this to work, you need to create an app on the Facebook Developer platform and create some ACF option fields to store the Facebook app id and secret key. Init this class somewhere and the Gutenberg embed block is working again with Instagram and Facebook links.
<?php
namespace JIJ\Services;
/**
* Class WordPressInstagramFacebookEmbed
*/
class WordpressInstagramFacebookEmbed
{
private static $providers = [