Skip to content

Instantly share code, notes, and snippets.

View bueltge's full-sized avatar
Always interested

Frank Bültge bueltge

Always interested
View GitHub Profile
@bueltge
bueltge / Mime-Types.php
Last active February 21, 2021 23:13
Change and Allow other mime types on upload
<?php
/**
* Plugin Name: Mime Types
* Description: Allow other mime types on upload
* Plugin URI:
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv2
* License URI: ./assets/license.txt
@bueltge
bueltge / wp-fix-enqueued-script-style-https.php
Last active February 21, 2021 23:13
Fix some badly enqueued scripts with no sense of HTTPS for the back end only.
<?php
/**
* Plugin Name: https Fix for enqueue scripts/styles
*/
// Fix some badly enqueued scripts with no sense of HTTPS for the back end only.
// Kudos to http://snippets.webaware.com.au/snippets/cleaning-up-wordpress-plugin-script-and-stylesheet-loads-over-ssl/
add_action( 'wp_print_scripts', 'fb_enqueueScriptsFix', 100 );
add_action( 'wp_print_styles', 'fb_enqueueStylesFix', 100 );
@bueltge
bueltge / listing-13-1.php
Last active February 21, 2021 23:10 — forked from WordPress-Handbuch/listing-13-1.php
Plugin to include only specific plugins in the automatic updates
<?php
/**
* Plugin Name: Control plugin update.
* Description: xyz
* Plugin URI: https://wpbuch.com/listing-13-1
* Version: 1.0.0
* Author:
* Author URI:
* Licence: GPLv2+
*/
@bueltge
bueltge / attachment-taxononimies.php
Created December 6, 2012 11:38
WordPress Attachment Taxonomies with WP 3.5*
<?php
/**
* Plugin Name: Attachment Taxonomies
* Plugin URI: attachment_taxonomies
* Text Domain: addquicktag
* Domain Path: /languages
* Description:
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
@bueltge
bueltge / disable-rest-api.php
Last active April 30, 2020 04:22
Disable WordPress REST API for users, there have not enough rights
<?php # -*- coding: utf-8 -*-
declare(strict_types=1);
/**
* Plugin Name: Disable REST API
*/
// Completely disable wp-json access.
add_filter(
'rest_authentication_errors',
function () {
<?php
/**
* Plugin Name: Remove Gravatar on Admin Bar
* Plugin URI: http://talkpress.de/artikel/wordpress-admin-bar-datenkrake-missbrauch
* Description: Remove Gravatar on Admin Bar
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv3
*/
@bueltge
bueltge / audit-performance.md
Last active December 31, 2019 13:32
Resources for Audit Performance

Resources

web.dev

Tools (online) for Audit Performance

Webhint

  • webhint is a customizable linting tool that helps you improve your site's accessibility, speed, cross-browser compatibility, and more
  • https://webhint.io/scanner/
@bueltge
bueltge / gutenberg-whitelist.php
Created December 4, 2019 12:10
Gutenberg Whitelist
<?php
/**
* Plugin Name: Control Gutenberg blocks.
* Description:
* Plugin URI: https://bueltge.de
* Version: 1.0.0
* Author:
* Author URI:
* Licence: GPLv2+
*/
@bueltge
bueltge / table.css
Created October 21, 2019 12:17
Simple Responsive Tables with Flexbox
/* Default table styles for this demo */
table {
border-collapse: collapse;
text-align: left;
width: 100%;
}
table tr {
background: white;
border-bottom: 1px solid
}
@bueltge
bueltge / gist:1097431
Created July 21, 2011 15:25
count the number of hits on a specific page in WordPress
function count_page_hits() {
if ( is_single() ) {
global $post;
$count = get_post_meta( $post -> ID, 'count_page_hits', true );
$newcount = $count + 1;
update_post_meta( $post -> ID, 'count_page_hits', $newcount );
}
}
add_action( 'wp_head', 'count_page_hits' );