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
/* | |
* Custom fields in custom admin columns | |
*/ | |
add_action( 'manage_orders_posts_custom_column', 'my_manage_orders_columns', 10, 2 ); | |
function my_manage_orders_columns( $column, $post_id ) { | |
global $post; | |
switch( $column ) { |
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 | |
/* | |
* Orders - Custom Columns | |
*/ | |
add_filter( 'manage_edit-orders_columns', 'my_edit_orders_columns' ) ; | |
function my_edit_orders_columns( $columns ) { | |
$columns = array( |
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 | |
function explodeMeTwice ($param) { | |
$id_pieces = explode("&", $param); | |
$new_piece = array(); | |
foreach ($id_pieces as $piece) { | |
$the_piece = explode("=", $piece); | |
$new_piece[$the_piece[0]] = $the_piece[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
/* | |
* When creating alias' and temp tables | |
* can't use where so use the | |
* HAVING keyword | |
*/ | |
SELECT | |
CONCAT(bill_first_name, ' ', bill_last_name) AS full_name, | |
COUNT(CONCAT(bill_first_name, ' ', bill_last_name)) AS amount, | |
MAX(ordered_on) as date, email |
NewerOlder