Skip to content

Instantly share code, notes, and snippets.

View glueckpress's full-sized avatar

Caspar Hübinger glueckpress

View GitHub Profile
@mgibbs189
mgibbs189 / functions.php
Created November 1, 2016 18:34
FacetWP - accessibility support
<?php
add_filter( 'facetwp_assets', function( $assets ) {
$assets['accessibility.js'] = FACETWP_URL . '/assets/js/src/accessibility.js';
return $assets;
});
@bueltge
bueltge / wp-i18n-cheatsheet.md
Last active April 2, 2022 13:57
WordPress i18n Cheatsheet

WordPress i18n CheatSheet

Whenever I write plugins or themes, there is one thing that needs a little extra attention and is quite frankly hard to get right: Translatable text. This list should helps me to find the right way fast.

Props to Alex Kirk, there list it inside a quiz.

You want to output the username in a sentence.

Assume that the $username has been escaped using esc_html().

@krafit
krafit / wpseo-iconfix.php
Created December 2, 2015 12:38
Nachdem der Schmerz, den wpSEO-Menüpunkt ansehen zu müssen zu groß wurde, habe ich das Icon im Admin-Menü ersetzt.
if (function_exists(wpseo_autoload)) {
function krafit_repair_wpseo() {
?>
<style>
#adminmenu #toplevel_page_wpseo div.wp-menu-image img {
display: none;
}
#adminmenu #toplevel_page_wpseo div.wp-menu-image::before {
content: "\f511";
@joehoyle
joehoyle / private-wp-api.php
Created October 14, 2015 18:37
Only allow access to the API for authenticated requests
<?php
add_filter( 'rest_pre_dispatch', function() {
if ( ! is_user_logged_in() ) {
return new WP_Error( 'not-logged-in', 'API Requests are only supported for authenticated requests', array( 'status' => 401 ) );
}
} );
@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@sergejmueller
sergejmueller / goodbye-wordpress.md
Last active July 13, 2016 11:19
Goodbye, WordPress!

Goodbye, WordPress!

Fast 9 Jahre und nahezu 3 Millionen Downloads später ist Schluss.
Schluss mit WordPress.

Für mich geht ein Lebensabschnitt zu Ende. Ein Lebensabschnitt, der unendlich viel Erfahrung, Learnings und Spaß mit sich brachte. Ein Lebensabschnitt, der aber unendlich viel Zeit, Nerven und Motivation mit sich nahm. Doch der Wille zählt und ich hoffe stark, dass meine Software und mein Engagement die WordPress-Community ein Stückchen besser, qualitativer gemacht haben.

// Bitteschön

INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@sergejmueller
sergejmueller / .htaccess
Last active June 16, 2016 08:34
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Apache
<FilesMatch "\.(txt|log|xml|css|js)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
@sergejmueller
sergejmueller / index.html
Created September 9, 2014 08:20
Prevent animation flickering on CSS3 Transitions/Transforms in Safari
<!DOCTYPE html>
<html>
<style>
html {
-webkit-font-smoothing: antialiased;
}
</style>