Skip to content

Instantly share code, notes, and snippets.

View Drivingralle's full-sized avatar

Ralf Wiechers Drivingralle

View GitHub Profile
@Drivingralle
Drivingralle / post_meta_filter.php
Last active January 13, 2020 01:12
A filter for get_post_meta value
function dr_filter_post_meta_value( $input, int $post_id, string $meta_key, bool $single ) {
// Don't run in admin interface
if ( is_admin() ) {
return $input;
}
// Get list of filter
global $wp_current_filter;
$filter_key = count( $wp_current_filter ) - 2;
@Drivingralle
Drivingralle / class-nc-wishlist-for-woocommerce-public.php
Created November 22, 2017 12:00
Fixed /nc-wishlist-for-woocommerce/public/class-nc-wishlist-for-woocommerce-public.php for NC Wishlist for WooCommerce version 1.0.1
<?php
/**
* HOTFIX: Manually modified file until plugin gets updated
*/
/**
* The public-facing functionality of the plugin.
*
* @package nc-wishlist-for-woocommerce
@Drivingralle
Drivingralle / decline-booking-row-action.php
Last active January 18, 2023 15:49
Add row/booking action button to decline a woocomerce booking
/*
* Add decline button to list view of woocommerce bookings
*/
function wocommerce_bookings_mods_add_custom_booking_status_button_to_bookings_list( $actions, $booking ) {
// Check if the booking requires a decision
if ( 'pending-confirmation' === $booking->get_status() ) {
// Add button to decline the booking
$actions['decline'] = array(
<?php
/**
* Plugin Name: Cross Media Cloud | Add language slug to blog name in admin bar
* Description: Show the blog language within the drop down of sites within the admin bar
* Version: 1.0
* Author: Cross Media Cloud
* Author URI: https://www.cross-media-cloud.de
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
@Drivingralle
Drivingralle / enqueue-styles-with-right-version.php
Created December 1, 2016 15:06
WordPress | Enqueue scripts/styles automaticly using right version number from parent-/child-theme
<?php
/*
* Enqueue parent and child theme style.css
*/
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles', 20 );
function my_theme_enqueue_styles() {
// Get the theme data
$my_theme = wp_get_theme();
@Drivingralle
Drivingralle / cmc-add-featured-image-to-feed.php
Created January 25, 2016 09:49
Add featured image to feed
@Drivingralle
Drivingralle / cmc-hide-update-notice.php
Created September 2, 2015 15:06
Hide update notice for non admin
<?php
/*
* Plugin Name: Hide update notice for non admin
* Description: Hide the information about updates for non-admin
* Version: 1.0
* Author: Cross Media Cloud
* Author URI: https://www.cross-media-cloud.de
* License: GPL
*/
@Drivingralle
Drivingralle / gist:f760ead9656963399bef
Last active August 29, 2015 14:10 — forked from wpmark/gist:5007195
Fix for version 1.0.1.
<?php
/**
* Plugin Name: User Switching | Admin Bar
* Plugin URI: http://markwilkinson.me
* Description: Build upon the User Switching plugin (http://wordpress.org/extend/plugins/user-switching/) by John Blackbourn and adds a dropdown list of users in the WordPress admin bar with a link to switch to that user.
* Author: Mark Wilkinson
* Author URI: http://markwilkinson.me
* Version: 1.0
*/