Skip to content

Instantly share code, notes, and snippets.

View benjaminpick's full-sized avatar

Benjamin Pick benjaminpick

  • Siegen, Germany
View GitHub Profile
<?php
/**
* Searches the database for transients stored there that match a specific prefix.
*
* @author Brad Parbs, Kellen Mace
* @param string $prefix prefix to search for.
* @return array nested array response for wpdb->get_results.
*/
function wds_campbell_search_database_for_transients_by_prefix( $prefix ) {
@oliverthiele
oliverthiele / ModelController.php
Created July 22, 2014 20:33
Debugging errors like "An error occurred while trying to call Vendor\ExtKey\Controller\ModelController->showAction() " in extbase extensions
/**
* A special action which is called if the originally intended action could
* not be called, for example if the arguments were not valid.
*
* The default implementation sets a flash message, request errors and forwards back
* to the originating action. This is suitable for most actions dealing with form input.
*
* We clear the page cache by default on an error as well, as we need to make sure the
* data is re-evaluated when the user changes something.
*
@ahemwe
ahemwe / calendar.php
Created May 28, 2014 19:36
php caldav to ical converter for mailbox.org
<?php
$userpwd = '<user>:<pwd>';
$baseurl = 'https://dav.mailbox.org/';
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=Kalender.ics');
// new cURL-Handle
$ch = curl_init();
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@ocean90
ocean90 / fbcbfwss.php
Last active February 11, 2023 22:03
WordPress Plugin: Filename-based cache busting for scripts/styles.
<?php
/**
* Plugin Name: Filename-based cache busting
* Version: 0.3
* Description: Filename-based cache busting for WordPress scripts/styles.
* Author: Dominik Schilling
* Author URI: https://dominikschilling.de/
* Plugin URI: https://gist.github.com/ocean90/1966227/
*
* License: GPLv2 or later