Skip to content

Instantly share code, notes, and snippets.

View finalwebsites's full-sized avatar

Olaf Lederer finalwebsites

View GitHub Profile
carlodaniele / media-hacks.php
Last active March 28, 2024 20:19
An example WP plugin which adds functionalities to the WordPress Media Library
* @package Media_hacks
* @version 1.0
Plugin Name: Media hacks
Plugin URI:
Description: This is an example plugin
Author: Carlo Daniele
mikaelz / delete-all-woocommerce-products.php
Last active March 15, 2024 12:53
Remove all WooCommerce products from database via SQL
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
qutek / woocommerce-ajax.php
Last active March 29, 2024 22:33
[Wordpress] [Woocommerce] WooCommerce Ajax Handlers
* WooCommerce Ajax Handlers
* Handles AJAX requests via wp_ajax hook (both admin and front-end events)
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/** Frontend AJAX events **************************************************/
JosefJezek / wp-plugin-periods-in-title.php
Created July 17, 2014 08:30
Wordpress Periods / Dots in Title / Slug / URL
Plugin Name: Periods in Title
Version: 1.0
Description: Allows periods to appear in post/category URIs
Author: Mark Jaquith
Plugin URI:
Author URI:
ChromeOrange / functions.php
Created August 31, 2012 12:20
Change Single Product Tab Titles and Headings
* Tab Title filters do not work with WooCommerce or lower
* Please download this zip file , extract the 3 files and copy them to :
* wp-content/themes/YOUR_THEME/woocommerce/single-product/tabs/
add_filter ( 'woocommerce_product_description_tab_title', 'custom_product_description_tab_title' ) ;
function custom_product_description_tab_title() {
bueltge / post-process.php
Created June 24, 2011 21:08
WordPress Custom Post Type: Insert post via Frontend
* post-process.php
* make sure to include post-process.php in your functions.php. Use this in functions.php:
* get_template_part('post-process');
function do_insert() {