Skip to content

Instantly share code, notes, and snippets.

Fuxia Scholz thefuxia

View GitHub Profile
@thefuxia
thefuxia / t5-highlight.php
Created Jun 1, 2017
WordPress plugin for highlight.js
View t5-highlight.php
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Highlight
* Description: Use highlight.js on front end. Mark code with <code>&lt;pre class="language-php"&gt;&lt;code&gt;your code&lt;/code&gt;&lt;/pre&gt;</code>
* Version: 31.10.14
* Required: 4.0
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
@thefuxia
thefuxia / Autoload.php
Created Jan 16, 2017
PSR 4 autoloader
View Autoload.php
<?php
namespace T5\Files;
/**
* Simple PSR-4 autoloader
* See http://codereview.stackexchange.com/a/150308/318 for an explanation
*/
class Autoload
{
/**
@thefuxia
thefuxia / login-form-widget.php
Last active Oct 23, 2016
WordPress Plugin: T5 Log In Form Widget
View login-form-widget.php
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Log in form widget
* Plugin URI: https://gist.github.com/toscho/c7459ee439fd2491c1f6
* Description: Shows a log in form in a widget.
* Version: 13.10.15
* Required: 4.0
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
@thefuxia
thefuxia / fix-https-apache.php
Created Jul 23, 2015
T5 Fix HTTPS header on Apache
View fix-https-apache.php
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Fix HTTPS header on Apache
* Version: 2015.07.23
* Author: toscho
* Author URI: http://toscho.de
* License: MIT
*/
if ( empty ( $_SERVER['SERVER_SOFTWARE'] ) )
return;
View whereami.php
<?php
/* Plugin Name: Where am I?
* Description: Adds the current server name and WordPress path to the admin footer.
* Version: 2015.07.04
* Author: toscho
* Author URI: http://wpkrauts.com/
* License: MIT
* License URI: http://opensource.org/licenses/MIT
*/
add_filter( 'admin_footer_text', function( $text ) {
@thefuxia
thefuxia / mock-wp-mail.php
Created Jun 22, 2015
Replace the pluggable function wp_mail() with a dummy.
View mock-wp-mail.php
<?php
// Plugin Name: Mock wp_mail()
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
return true;
}
@thefuxia
thefuxia / t5-editor-shortlink.php
Created May 8, 2015
WordPress Plugin: T5 Editor Shortlink
View t5-editor-shortlink.php
@thefuxia
thefuxia / t5-short-feed.php
Last active Aug 29, 2015
WordPress Plugin: T5 Short Feed
View t5-short-feed.php
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Short Feed
* Plugin URI: https://gist.github.com/toscho/86d6ebcdec3be4d04af8
* Description: Creates a feed with just the excerpt, no matter what you have set for the main feed. Please visit the permalinks page once after activation. The feed is then available at <code>/feed/summary/</code>. Requires PHP 5.3.
* Version: 07.05.15
* Required: 4.2
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
View plugin-debug-request.php
<?php
/**
* Plugin Name: T5 Debug Request
*/
is_admin() || add_action( 'shutdown', function() {
if ( ! current_user_can( 'update_core' ) )
return;
print '<pre>REQUEST';
View disable-open-sans.php
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Disable Open Sans
* Version: 2015.04.01
* Author: toscho
* License: MIT
*/
add_filter( 'gettext_with_context', 'disable_open_sans', 10, 4 );
You can’t perform that action at this time.