Skip to content

Instantly share code, notes, and snippets.

View quasel's full-sized avatar
🙃
Don't worry be happy!

Bernhard quasel

🙃
Don't worry be happy!
View GitHub Profile
@quasel
quasel / gist:39093dfd234f08f8b7bbeb5bd9ef2f33
Created September 25, 2020 18:14 — forked from sc0ttkclark/gist:5071618
In Pods 2.3, you can now add custom relationship objects quickly and easily. Add predefined lists, integrate with other plugins and their data, or do whatever you want just about! The custom relationships will appear in the 'Relate to' options for a Relationship Field. This is a simple example meant for basic key/value data.
<?php
add_action( 'init', 'add_my_related_objects' );
function add_my_related_objects () {
$options = array(
'data' => array(
1 => 'Option 1',
2 => 'Option 2'
)
);
@quasel
quasel / functions.php
Created August 14, 2020 15:34 — forked from Zodiac1978/functions.php
Remove events from a specified event category in "The Events Calendar" by Modern Tribe
<?php
/**
* The Events Calendar Remove Events from Month and List Views
*
* @param [object] $query Query of the events page.
* @return [object] Modified Query
*/
function tribe_exclude_events_category_month_list( $query ) {
if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) ) {
<?php
add_filter('fluenform_rendering_field_data_select', function ($data, $form) {
if ($form->id != 91) {
return $data;
}
// do the dynamic part if and only the name attriibute is 'dynamic_dropdown'
// Please use the corresponding field name for your case.
if (\FluentForm\Framework\Helpers\ArrayHelper::get($data, 'attributes.name') != 'dynamic_dropdown') {
return $data;
@quasel
quasel / remove-woo-scripts.php
Created March 1, 2020 09:43 — forked from jan-koch/remove-woo-scripts.php
Remove WooCommerce related resources except on WooCommerce-based pages (products, cart, checkout, etc). Use on a testing environment before pasting this into your live website!
/**
* This code snippet removes JavaScript and CSS files loaded from WooCommerce if they are not necessary.
*
* Please test this on a staging copy of your website before putting this into the functions.php of your live website.
*/
add_action( 'wp_enqueue_scripts', 'my_remove_woo_assets', 99 );
function my_remove_woo_assets() {
if ( function_exists( 'is_woocommerce' ) ) { // Check if Woo is installed.
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { // Only run on non-Woo pages.
// Remove unnecessary stylesheets.
@quasel
quasel / bb-loop-query-args.php
Created February 14, 2020 18:57 — forked from carlosonweb/bb-loop-query-args.php
Beaver Builder Filter Hook: fl_builder_loop_query_args To Filter by Meta Keys
/**
* Add this to the child theme's functions.php file.
*/
add_filter( 'fl_builder_loop_query_args', function( $query_args ){
$today = date( 'd.m.Y', time() );
// Past ( today > start_date )
if ( 'PAST_POST_MODULE_ID_HERE' == $query_args[ 'settings' ]->id ) {
$query_args[ 'meta_query' ] = array(
'key' => 'end_date',
@quasel
quasel / functions.php
Created January 5, 2019 12:03 — forked from bordoni/functions.php
How to add the Venue on The Events Calendar Month Tooltip
<?php
/*
* If you already have something in your functions.php, please remove these first few lines
*/
function tec_forum_939516( $json, $event, $additional ){
$venue = tribe_get_venue_id( $event );
if ( $venue ){
$json['venue'] = $venue;
@quasel
quasel / teamspeak3-init.d.sh
Created September 19, 2018 18:27 — forked from Zeuh/teamspeak3-init.d.sh
A TeamSpeak3 init.d script
#!/bin/bash
### BEGIN INIT INFO
# Provides: teamspeak
# Required-Start: networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description: Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO
@quasel
quasel / please-include-a-repro.md
Created September 4, 2018 11:24 — forked from Rich-Harris/please-include-a-repro.md
Please include a repro

Please include a repro

You probably arrived here because of a curt message in response to an issue you filed on a repo that I contribute to. Sorry about that (particularly if you filed the issue long ago and have been waiting patiently for a response). Let me explain:

I work on a lot of different open source projects. I really do like building software that makes other people's lives easier, but it's crazy time-consuming. One of the most time-consuming parts is responding to issues. A lot of OSS maintainers will bend over backwards to try and understand your specific problem and diagnose it, to the point of setting up new test projects, fussing around with different Node versions, reading the documentation for build tools that we don't use, debugging problems in third party dependencies that appear to be involved in the problem... and so on. I've personally spent hundreds of hours of my free time doing these sorts of things to try and help people out, because I want to be a responsible maintainer and I

@quasel
quasel / functions.php
Created September 3, 2018 12:30 — forked from elimn/functions.php
MT | TEC | Tribe Query Debug
<?php
// Checks the URL for the debug parameter
// example.com/event/event-name/?tribe_query_debug=true
function tribe_events_pre_get_posts_dumper ($query) {
$show_debug_info = isset($_GET['tribe_query_debug']) ? $_GET['tribe_query_debug'] : false;
if(($show_debug_info == "true" && $query->is_main_query() === true) || $show_debug_info == "full") {
echo "<h3>&lt;Tribe Events Query&gt;</h3>";
tribe_spit_it_out($query);
@quasel
quasel / tec-pro-mini-hide-event-list.php
Created August 30, 2018 09:57 — forked from jesseeproductions/tec-pro-mini-hide-event-list.php
The Events Calendar Pro - Hide Mini Calendar Event List Until Calendar Date is Clicked
/*
* The Events Calendar Pro - Hide Mini Calendar Event List Until Calendar Date is Clicked
* TEC PRO @3.11.1
*/
add_action( 'wp_footer', 'tribe_hide_mini_calendar_list_until_clicked', 50 );
function tribe_hide_mini_calendar_list_until_clicked() {
?>
<script>
var $ = jQuery.noConflict();