This is an example snippet for forcing the Gutenberg editor into full screen mode in anticipation of the change coming to WordPress 5.4.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Hello Taylor | |
Plugin URI: https://gist.github.com/lgladdy/9e1a7303c6a6bf43b9b1 | |
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in <strike>two</strike> words sung most famously by <strike>Louis Armstrong: Hello, Dolly.</strike>Taylor Swift. When activated you will randomly see a lyric from <strike><cite>Hello, Dolly</cite></strike><cite>Taylor Swift</cite> in the upper right of your admin screen on every page. | |
Author: Liam Gladdy (based on Hello Dolly by Matt Mullenweg) | |
Version: 1.1 | |
Author URI: http://www.twitter.com/lgladdy & http://ma.tt/ | |
*/ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Comments added to deleted comments and answers, visible for the post author only. | |
Sorry, but this is not [an answer](http://wordpress.stackexchange.com/questions/how-to-answer). | |
[An answer should be more than just a link to an external site](http://wordpress.stackexchange.com/help/deleted-answers). Please add a solution. | |
[Ask a new question.](http://wordpress.stackexchange.com/questions/ask) Please don’t misuse the answer field for questions. Thanks. | |
[You must disclose your affiliation in your answers.](http://wordpress.stackexchange.com/help/behavior) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('gettext',fn($t)=> | |
@$t[4]&&@$GLOBALS['wp_locale'] | |
?["Such $t","Very $t",'Wow'][rand(0,2)] | |
:$t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// No, Thanks. Direct file access forbidden. | |
! defined( 'ABSPATH' ) AND exit; | |
// INIT | |
add_action( 'after_setup_theme', array( 'unavailable_post_status', 'init' ) ); | |
class unavailable_post_status extends wp_custom_post_status | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Usage: | |
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
if ( !$frag->output() ) { // NOTE, testing for a return of false | |
functions_that_do_stuff_live(); | |
these_should_echo(); | |
// IMPORTANT | |
$frag->store(); | |
// YOU CANNOT FORGET THIS. If you do, the site will break. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Rarst\GitHub\Gist; | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Command\Guzzle\Description; | |
use GuzzleHttp\Command\Guzzle\GuzzleClient; | |
/** | |
* Build Gist comments feed for specific user, using GitHub API. |