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
$total = count( get_posts( array( | |
'post_type' => 'mvp-card', | |
'posts_per_page' => - 1, | |
'suppress_filters' => false, | |
'connected_direction' => 'from', | |
'connected_type' => 'activity-to-mvp-card', | |
'connected_items' => $activity_id | |
) ) ); |
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
add_action( 'init', 'baja_check_search_box' ); | |
function baja_check_search_box() { | |
if ( empty( $_POST['search_box'] ) ) | |
return; | |
wp_redirect( site_url( '$_POST['region'] . '/' . $_POST['post-type'] ) ); | |
die; | |
} |
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
$(document).ready(function() { | |
$('a').click( function() { | |
if ( $.attr(this, 'href').indexOf( '#' ) != 0 ) | |
return; | |
var scrollTo = $( $.attr(this, 'href') ).offset().top; | |
scrollTo -= $( '.site-header-container' ).height(); | |
$('html, body').animate({ | |
scrollTop: scrollTo | |
}, 500); | |
return false; |
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 pank_wp_reset_postdata( $query ) { | |
if ( !is_a($query, 'WP_Query' ) ) | |
return false; | |
if ( !empty($query->post) ) { | |
$GLOBALS['post'] = $query->post; | |
setup_postdata($query->post); | |
} | |
} |
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 | |
add_filter( 'woocommerce_payment_complete_order_status', 'subscription_order_payment_onhold_order_status', 10, 2 ); | |
/** | |
* Catch new subscription orders, and put the order on-hold by default. | |
*/ | |
function subscription_order_payment_onhold_order_status( $order_status, $order_id ) { | |
$order = new WC_Order( $order_id ); | |
if ( 'processing' != $order_status || ( 'on-hold' != $order->status && 'pending' != $order->status && 'failed' != $order->status ) ) |
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
if ( file_exists( $medium ) ) | |
/** | |
* File to delete | |
* | |
* @since 2.8.0 | |
*/ | |
@unlink( apply_filters( 'wp_delete_file', $medium ) ); |
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
egrep -R -l '(do_action|apply_filters)' * | subl | |
o wp-activate.php | |
o wp-admin/admin-ajax.php | |
o wp-admin/admin-footer.php | |
o wp-admin/admin-header.php | |
o wp-admin/admin-post.php | |
o wp-admin/admin.php | |
o wp-admin/async-upload.php | |
o wp-admin/comment.php |
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
<!--[if lte IE 9]> | |
// ie stylesheet | |
<!--[endif]> | |
<!--[if !lte IE 9]> | |
// regular stylesheet | |
<!--[endif]> | |
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 | |
add_action( 'parse_query', 'maybe_parse_query_for_find_posts' ); | |
function maybe_parse_query_for_find_posts( $query ) { | |
if ( empty( $_REQUEST['action'] ) || $_REQUEST['action'] != 'find_posts' ) | |
return; | |
$query->set( 'order', 'something else' ); | |
} |
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
# Leave a comment on this post with the file(s)* you’re about to edit (check the comments first to make sure it’s not already being edited) | |
# <a href="core.trac.wordpress.org/newticket">Create a new ticket on trac</a> for the file. Follow the format for the title "Hooks documentation in path/to/file.php". Assign the ticket to the "Inline Docs" component | |
# Edit fervently and make a patch quickly | |
# Rinse and repeat! |