Skip to content

Instantly share code, notes, and snippets.

View s-a-s-k-i-a's full-sized avatar
🥰

Saskia Lund s-a-s-k-i-a

🥰
View GitHub Profile
@s-a-s-k-i-a
s-a-s-k-i-a / sql_php_example.php
Last active April 26, 2023 16:00
How to use an SQL query for multiple meta_key and meta_value pairs with PHP from WordPress Database - example: Finding FooEvents Cancelled Tickets
<?php
/**
*
* This function returns the number of canceled tickets of a specific FooEvents WooCommerce product.
* @author Saskia Teichmann | wp-studio.dev
*
* @param int $event_product_id.
* @return int
*/
function wpstudiodev_get_number_of_canceled_tickets($event_product_id){
@s-a-s-k-i-a
s-a-s-k-i-a / unset_gateway_by_category
Created September 21, 2022 18:36
Unset payment gateway if a product in specific category is in cart _ WooCommerce
<?php
/**
* @snippet Disable Payment Method for Specific Category
*
*/
function my_unset_gateway_by_category( $available_gateways ) {
global $woocommerce;
$parentCatID = '';
$category_IDs = array( 373, 436, 374, 375, 380, 376 );
if(!is_admin()){
@s-a-s-k-i-a
s-a-s-k-i-a / et-meta-hawk.php
Last active February 15, 2020 16:08 — forked from andrasguseo/et-meta-hawk.php
Event Tickets Plus Meta Editor for Attendee Data (WooCommerce Only)
<?php
/**
* Plugin name: Event Tickets Meta Hawk
* Description: Lets site administrators soar over attendee meta data supplied by attendees then swoop down, hawk-like, to change it. Proof of concept targeting the WooCommerce provider.
* Version: 2019-08-03
* Author: Barry Hughes
*
* Contributor: Saskia Lund
*
* Experiment in making attendee meta editable via the attendee screen.
@s-a-s-k-i-a
s-a-s-k-i-a / functions.php
Last active July 9, 2019 10:30
WordPress: List Category Posts feat. Yoast SEO while using custom category.php with catlist shortcode
/*
* @author Saskia Lund
* @authorurl https://www.saskialund.de/
*
* When Yoast SEO and List Category Posts are activated alongside each other,
* there is an issue regarding canonicals and rel=next and rel=prev urls displayed in head html.
* List Category Posts is making use of its own pagination methods, while Yoast SEO is being WP codex compliant
* and is making use of WP pagination methods.
*
* Preparations
@s-a-s-k-i-a
s-a-s-k-i-a / wp-amp-tutorial-primary-nav.php
Created February 13, 2019 16:39 — forked from johnregan3/wp-amp-tutorial-primary-nav.php
Adding a Primary Navigation Menu to an AMP WordPress Theme
<?php
/**
* Register the amp-sidebar component script with WP AMP.
*
* This goes in your amp.php
*/
function jr3_amp_sidebar_component_script( $data ) {
$data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js';
return $data;
}