Skip to content

Instantly share code, notes, and snippets.

@CoachBirgit
CoachBirgit / generate-dummy-posts-with-featured-images.sh
Created January 19, 2022 10:40
Use WP-CLI on Laravel/Valet to generate some dummy content with featured images
@davemac
davemac / wp-cli delete all featured images of a post type
Last active September 5, 2022 12:43
wp-cli delete all featured images of a post type
wp post list --post_type=dmc-sief-project --fields=ID --format=csv | xargs -I % wp post meta delete % _thumbnail_id
@hostz-frank
hostz-frank / functions.php
Last active March 13, 2018 11:05
Im Divi-Theme das Laden externer Google-Fonts abschalten. / Disable external pulled web fonts from Google for the Divi theme
<?php
// Copy the code below into your Divi child(!) theme's functions.php
/**
* Disable external font load from Google.
*
* Useful after putting Google fonts on your own server;
* see https://google-webfonts-helper.herokuapp.com/fonts
*/
@felixarntz
felixarntz / wp-alignment-classes.css
Created November 24, 2017 15:52
New WordPress alignment classes introduced by Gutenberg
/* -------------------------------------------------------------
# Variables
------------------------------------------------------------- */
$site_maxwidth: 72rem; // Maximum width the entire site should not exceed
$site_maxwidth-text: 40rem; // Maximum width the main content text should not exceed
$spacing_horizontal: 1rem; // General horizontal padding
/* -------------------------------------------------------------
# General Styles
<?php
/**
* Plugin Name: Give - Free
**/
/**
* Register our plugin so it shows up as an option in the Give gateway settings
*/
add_filter( 'give_payment_gateways', function() {
// Here replace 'give_free' with a unique slug for your plugin. You will use this slug throughout this plugin.
@scottopolis
scottopolis / wp-api-custom-taxonomies.php
Created October 27, 2015 22:27
Add custom taxonomies to the WP-API
<?php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
}
}
add_action( 'init', 'ms_add_tax_to_api', 30 );
@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:

@ultimatemember
ultimatemember / gist:5f725bff6bcf79d2988e
Last active January 22, 2020 19:00
Using notifications API to add custom notifications
/*
This code sample shows you how to use the API to create
and add custom notifications (for real-time notifications)
plugin.
STEP 1: You need to extend the filter: um_notifications_core_log_types with your
new notification type as follows for example
*/
@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

@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active April 25, 2024 12:11
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)