Skip to content

Instantly share code, notes, and snippets.

View Zodiac1978's full-sized avatar
🤔
Overthinking things since 1978

Torsten Landsiedel Zodiac1978

🤔
Overthinking things since 1978
View GitHub Profile
@sergejmueller
sergejmueller / .htaccess
Last active March 9, 2016 09:54
Set X-Frame-Options SAMEORIGIN for all files but not for /embed/ files.
<IfModule mod_setenvif.c>
SetEnvIf Request_URI "/embed/$" IS_embed
Header set X-Frame-Options SAMEORIGIN env=!REDIRECT_IS_embed
</IfModule>
@zottto
zottto / wordpress-snippet-remove-login-messages.php
Last active January 27, 2017 18:17
Ein Snippet, um die Login-Meldungen von WordPress zu vereinheitlichen. In einem Custom Plugin benutzen...
<?php
function wp_modify_login_error_incorrect_password($user) {
if ( is_wp_error( $user ) ) {
$error_string = $user->get_error_message();
if ($user->get_error_code() == 'incorrect_password') {
$user = new WP_Error('invalid_username', $error_string);
}
}
return $user;
}
@glueckpress
glueckpress / cachify-custom-admin-bar-icon.php
Last active December 27, 2015 21:01
[WordPress][Cachify] Mini plugin to move Cachify’s trash icon to the primary/left part of the admin bar.
<?php
/**
* Plugin Name: Cachify | Customize admin bar icon.
* Description: Moves Cachify’s trash icon to the primary/left part of the admin bar.
* Version: 2015.12
* Author: Caspar Hübinger
* Author URI: https://profiles.wordpress.org/glueckpress/
* Plugin URI: https://gist.github.com/glueckpress/0ccc84e6f93b89dee1d3
* License: GNU General Public License v3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@glueckpress
glueckpress / wpseo-iconfix.php
Last active October 2, 2018 23:12 — forked from krafit/wpseo-iconfix.php
[WordPress] Nachdem der Schmerz, den wpSEO-Menüpunkt ansehen zu müssen zu groß wurde, hat @krafit das Icon im Admin-Menü ersetzt. Ich hab’s in ein Plugin gewickelt, Torsten hat’s aktualisiert.
<?php
/**
* Plugin Name: wpSEO Icon Fix
* Description: Admin icon hack for wpSEO.
* Version: 2018.08
* Author: Simon Kraft, Caspar Hübinger, Torsten Landsiedel
* License: GNU General Public License v3
* License URI: http://www.gnu.org/licenses/gpl-3.0.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";
@glueckpress
glueckpress / hallo-welt.md
Last active February 10, 2016 10:58
Hallo Welt!

Hallo Welt!

Read in English

Sergej Müller hat seinen Abschied von WordPress angekündigt. Damit seine hochgeschätzten freien Plugins nicht verschwinden, haben wir zu diesem Zweck ein Team gebildet. Wichtig ist uns, die Datenschutz-Konformität der Plugins zu erhalten und eine kommerzielle Nutzung der Domains zu verhindern.

Mit mehreren Personen aus der deutschsprachigen Community führen wir die 11 freien Plugins weiter. Dies sind im Einzelnen:

@dimadin
dimadin / curly-quotes.php
Created May 11, 2015 16:01
Filtering WordPress curly quotes
<?php
function md_filter_curly_double_quotes( $translations, $text, $context, $domain ) {
if ( 'opening curly double quote' == $context && '&#8220;' == $text ) {
$translations = '&#0171;';
} else if ( 'closing curly double quote' == $context && '&#8221;' == $text ) {
$translations = '&#0187;';
}
return $translations;
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 / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@glueckpress
glueckpress / woocommerce-delete-customer-ip.php
Created January 9, 2014 15:29
Snippet to clear customer IP address when order is sent. #woocommerce #wordpress
<?php
/**
* Snippet for deleting the customer IP address from WooCommerce orders.
* Important for Trusted Shops® certificates in Germany.
*/
add_action( 'woocommerce_checkout_update_order_meta', 'mp1401091554', 1 );
function mp1401091554( $order_id ) {
update_post_meta(
$order_id,
'_customer_ip_address',