Skip to content

Instantly share code, notes, and snippets.

{"sig":"b4ee7efdf18f40157f2e189d04ad4f1d895633e4b9036d7bb276a69c6cc20cabc33ce4999e4116d9ec4308c0063393bcc6afdf62d917f010f7ebfd2b0d8d76551","msghash":"5bc5382e956142a65949eed71f806d1d0fad1167d3f68e4cdf2d0aa1a8af19cb"}
<?php
/*
Plugin Name: Disable Full Size Image
Description: This plugin removes the "Original Size" option in the drop down when inserting an image into a post
Version: 0.1
Author: Bernhard Kau
Author URI: http://kau-boys.de
*/
function disable_full_size_image( $image_size_names ) {
@bewho
bewho / functions.php
Created February 7, 2018 11:31
M11 functions
<?php
/*
Plugin Name: M11 Theme Features
Plugin URI: https://speedword.press
Description: Das Plugin muss sich im Ordner wp-content/mu-plugins/ befinden. Ebenfalls muss in der wp-config autoupdaten aktiviert sein.
Author: Daniel Bieli
Author URI: https://speedword.press
License: GPL2
*/
########################################################################################
# bewho's robots.txt file for RadarTek websites
########################################################################################
User-agent: *
Allow: /
Allow: /robots.txt
Allow: /*.png*
Allow: /*.jpg*
Allow: /*.jpeg*
@bewho
bewho / wp_functions.php
Created January 25, 2018 16:15 — forked from Kobe/wp_functions.php
deactivate anything in wp_head
<?php
// add theme support for
add_theme_support('html5');
add_theme_support('menus');
add_theme_support('post-formats', array(
'aside',
'image',
'link',
'status'
));
@bewho
bewho / wp-config.php
Created January 23, 2018 14:02 — forked from MikeNGarrett/wp-config.php
Disable admin-ajax on the front-end of WordPress sites and cache the resulting 404.
<?php
if(
strpos( $_SERVER['HTTP_REFERER'], 'wp-admin' ) === false &&
strpos( $_SERVER['REQUEST_URI'], 'admin-ajax.php' ) !== false
) {
header( 'Cache-Control: max-age=30000, must-revalidate' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+5000 minutes' ) ) . ' GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( '-5000 minutes' ) ) . ' GMT' );
header( $_SERVER["SERVER_PROTOCOL"]." 404 Not Found" );
die;
@bewho
bewho / functions.php
Created January 23, 2018 13:56 — forked from MikeNGarrett/functions.php
Set cache headers on WordPress 404 pages.
<?php
/**
* Force cache headers on 404 pages and prevent WordPress from handling 404s.
*
* @param bool $preempt determines who handles 404s.
* @param obj $wp_query global query object.
*/
function change_404_headers( $preempt, $wp_query ) {
if ( ! is_admin() && ! is_robots() && count( $wp_query->posts ) < 1 ) {
header( 'Cache-Control: max-age=30000, must-revalidate' );
@bewho
bewho / paste-as-plain-text.php
Created January 23, 2018 02:29 — forked from tillkruss/paste-as-plain-text.php
Force the WordPress editor to always paste as plain text.
<?php
// always paste as plain text
foreach ( array( 'tiny_mce_before_init', 'teeny_mce_before_init') as $filter ) {
add_filter( $filter, function( $mceInit ) {
$mceInit[ 'paste_text_sticky' ] = true;
$mceInit[ 'paste_text_sticky_default' ] = true;
return $mceInit;
});
}
@bewho
bewho / index.html
Created January 23, 2018 01:44 — forked from hsquareweb/index.html
Collapsable/Toggle Links
<ul class="collapse_list">
<li><a href="#" data-toggle="collapse" data-target="#one">One</a></li>
<li><a href="#" data-toggle="collapse" data-target="#two">Two</a></li>
</ul>
<div class="collapse_content">
<div id="one">
<p>Content for div one</p>
</div>
@bewho
bewho / quote-author.php
Created January 21, 2018 00:19 — forked from thefuxia/quote-author.php
WordPress Plugin Quote Author
<?php # -*- coding: utf-8 -*-
/*
Plugin Name: Custom Taxonomy Quote Author
Plugin URI: https://gist.github.com/996608
Description: Creates a custom taxonomy <code>Quote Author</code> with an URI <code>/qa/author-name/</code>
Version: 1.0
Required: 3.1
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL