This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WCS 1.4 Upgrade Fix | |
* Plugin URI: | |
* Description: Custom plugin to fix a database that fell out of sync with Subscriptions 1.4's database structure. | |
* Author: Brent Shepherd | |
* Author URI: | |
* Version: 1.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( window, undefined ) { | |
'use strict'; | |
function WP_API() { | |
this.models = {}; | |
this.collections = {}; | |
this.views = {}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'WP_DEBUG' ) ) { | |
define('WP_DEBUG', true); | |
} | |
if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { | |
define('WP_DEBUG_DISPLAY', false); | |
} | |
if ( ! defined( 'WP_DEBUG_LOG' ) ) { | |
define('WP_DEBUG_LOG', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WooCommerce Subscriptions Remove $0.00 Recurring Discount | |
Plugin URI: | |
Description: Do not include a $0.00 recurring discount amount when a coupon is displaying it. For example, instead of display a coupon discount as "$10.00 now then $0.00 / month", display it as "$10.00". | |
Author: | |
Author URI: | |
Version: 0.1 | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Custom Post Type Capabiltiies Test | |
Plugin URI: http://wordpress.org/ | |
Description: Testing to see if a subscriber without edit_others capability can edit posts. | |
Author: Brent | |
Version: 1 | |
*/ | |
function ppt_register_post_type() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Unobtrusively gets the IDs of all posts in the current query, not just the posts shown on the current page. | |
* | |
* @author Brent Shepherd <brent@findingsimple.com> | |
* @since 1.0 | |
*/ | |
function eg_get_all_posts_in_query() { | |
global $wp_query; | |
// Turn paging off & specify that we only want post IDs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/(\<[^\>]+\>)([^\<]+)(\<\/[^\>]+\>)?/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pattern = '/([^a-zA-Z0-9-_>\[])(' . preg_quote( $given_term ) . ')([^a-zA-Z0-9-_<\]])(?!([^<]*)(\>|\<\/a|\]|<\/h\d\>))/i' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(_e\(\s*'[^']*')(\s*)(?=\))(\)) | |
(__\(\s*'[^']*')(\s*)(?=\))(\)) | |
Or do them in both, also account for strings using "" instead of just '': | |
(_[e|_]\(\s*['|"][^,'"]*['|"])(\s?)(?=\))(\){1}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT SUM(LENGTH(`post_content`) - LENGTH(REPLACE(`post_content`,' ',''))+1) | |
FROM `wp_posts` |
OlderNewer