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 | |
/** | |
* Loop through an order's items and see if there's a free trial set | |
* | |
* @param WC_Order $order | |
* @return bool|WP_Error | |
*/ | |
function custom_order_has_trial( $order ) { | |
if ( ! $order instanceof WC_Order ) |
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
$all_posts = $wpdb->get_results(" | |
SELECT wp_posts.ID,wp_posts.post_date,wp_posts.post_title,wp_posts.post_name, | |
wp_terms.name,wp_terms.slug,wp_term_taxonomy.description | |
from wp_posts | |
join wp_term_relationships on wp_posts.ID = wp_term_relationships.object_id | |
join wp_terms on wp_term_relationships.term_taxonomy_id = wp_terms.term_id | |
join wp_term_taxonomy on wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id | |
WHERE wp_posts.post_status = 'publish' | |
ORDER BY wp_terms.slug,wp_posts.ID; | |
", ARRAY_A); |
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 | |
/* | |
UPDATED: December 31, 2011. | |
Modifications: | |
- Truncated the longest country names, including: | |
-- British Indian Ocean Territories (Chagos Archipelago) -> British Indian Ocean Territories | |
-- South Georgia and the South Sandhich Islands -> South Georgia & S. Sandwich Islands |