WooCommerce has a strange way to register its tables.
$sql = "
SELECT DISTINCT TABLE_NAME
FROM information_schema.columns
WHERE TABLE_NAME LIKE '{$wpdb->prefix}woocommerce_%'";
$tables = $wpdb->get_col( $sql );
<?php | |
/** | |
* Class Mlp_Redirect | |
* | |
* @version 2014.04.28 | |
* @author Inpsyde GmbH, toscho | |
* @license GPL | |
*/ | |
class Mlp_Redirect { |
<?php | |
// In inc/pro/controllers/Mlp_Duplicate_Blogs.php, | |
// at the end of Mlp_Duplicate_Blogs::wpmu_new_blog() | |
$context = array ( | |
'source_blog_id' => $source_blog_id, | |
'new_blog_id' => $blog_id | |
); | |
/** |
<?php | |
/** | |
* Remove callbacks for problematic hooks. | |
* | |
* Many plugins and themes do not check for a switched site context, they will | |
* save $_POST data to the wrong site. This class tries to remove all those | |
* callbacks. | |
* | |
* @version 2014.07.23 | |
* @author Inpsyde GmbH, toscho |
WooCommerce has a strange way to register its tables.
$sql = "
SELECT DISTINCT TABLE_NAME
FROM information_schema.columns
WHERE TABLE_NAME LIKE '{$wpdb->prefix}woocommerce_%'";
$tables = $wpdb->get_col( $sql );
<?php # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: Post Meta Test | |
* Description: Adds a simple post meta field below the title to the post editor screen. | |
* Plugin URI: http://marketpress.com/ | |
* Version: 2014.09.12 | |
* Author: MarketPress, Thomas Scholz | |
* Author URI: http://marketpress.com/ | |
* Licence: GPL 2 | |
* License URI: http://opensource.org/licenses/GPL-2.0 |
<?php # -*- coding: utf-8 -*- | |
interface Url { | |
public function get_url(); | |
} | |
class Basic_Url implements Url { | |
private $url; |
<?php | |
add_action( 'wp_footer', function() { | |
$mlp_language_api = apply_filters( 'mlp_language_api', NULL ); | |
if ( is_a( $mlp_language_api, 'Mlp_Language_Api_Interface' ) ) { | |
$args = [ | |
'site_id' => get_current_blog_id(), | |
'content_id' => get_queried_object_id(), |
<?php | |
/* Plugin Name: T5 Category Feed Links */ | |
add_action( 'wp_head', function() { | |
$cats = get_categories(); | |
$html = '<link rel="alternate" type="%1$s" title="Category %2$s" href="%3$s" />'; | |
$type = feed_content_type(); | |
foreach ( $cats as $cat ) { |
<?php # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Refresh RSS Widget | |
* Plugin URI: https://gist.github.com/toscho/47fc50f875473ee537e6 | |
* Description: Refresh the feed for the built-in RSS widget every two hours. | |
* Version: 03.01.15 | |
* Required: 4.0 | |
* Author: Thomas Scholz <info@toscho.de> | |
* Author URI: http://toscho.de | |
* License: MIT |