Skip to content

Instantly share code, notes, and snippets.

View gchtr's full-sized avatar

Lukas Gächter gchtr

View GitHub Profile
@gchtr
gchtr / class-theme-day-of-week-simple-filter.php
Created May 20, 2022 07:01
Custom Day of Week filter for "The Events Calendar" plugin that filters events that only start on the selected dates.
<?php
use Tribe\Events\Filterbar\Views\V2\Filters\Day_Of_Week;
/**
* Class Theme_Day_Of_Week_Simple_Filter
*
* @see \Tribe\Events\Filterbar\Views\V2\Filters\Day_Of_Week
* @see \Tribe__Events__Filterbar__Filters__Day_Of_Week
*/
<?php
add_filter( 'tiny_mce_before_init', function( $settings ) {
// Set pasting as text as default. No more foreign style in the editor
$settings['paste_as_text'] = true;
return $settings;
} );
@gchtr
gchtr / Acf_Current_Tab.php
Last active January 25, 2017 17:10
WordPress + ACF: Keep the last edited tab selection when post refreshes
<?php
// Drop this into your functions.php
/**
* ACF: Keep the last edited tab selection when post refreshes.
*
* When a post containing ACF tabs is opened for edits, the currently selected tab
* will be saved in a transient. Upon save or refresh of the page, the last selected
* tab will be selected again, making it more convenient to work with ACF tabs.