This file contains hidden or 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
# Install Mailcatcher | |
if [ ! -f /var/log/mailcatchersetup ]; | |
then | |
sudo /opt/vagrant_ruby/bin/gem install mailcatcher | |
sudo touch /var/log/mailcatchersetup | |
fi | |
# Configure sendmail_path for MailCatcher | |
sudo sed -i '/;sendmail_path =/c sendmail_path = "/opt/vagrant_ruby/bin/catchmail"' /etc/php5/apache2/php.ini |
This file contains hidden or 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
check_ajax_referer( 'bk-ajax-nonce', 'security', false ); |
This file contains hidden or 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
check_ajax_referer( 'bk-ajax-nonce', 'security' ); |
This file contains hidden or 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
<script type="text/javascript"> | |
jQuery( document ).ready( function ( $ ) { | |
var data = { | |
action: 'my_action', | |
security: '<?php echo wp_create_nonce( "bk-ajax-nonce" ); ?>' | |
}; | |
$.post( ajaxurl, data, function ( response ) { | |
alert( "Response: " + response ); | |
} ); | |
} ); |
This file contains hidden or 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 | |
echo '<input type="hidden" name="bk-ajax-nonce" id="bk-ajax-nonce" value="' . wp_create_nonce( 'bk-ajax-nonce' ) . '" />'; | |
?> | |
<script type="text/javascript"> | |
jQuery( document ).ready( function ( $ ) { | |
var data = { | |
action: 'my_action', | |
security: $( '#bk-ajax-nonce' ).val() | |
}; | |
$.post( ajaxurl, data, function ( response ) { |
This file contains hidden or 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
error_log( print_r( $special_object, 1 ), 0 ); |
This file contains hidden or 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
error_log( 'Test error message', 0 ); |
This file contains hidden or 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
define('WP_DEBUG', true); | |
if ( WP_DEBUG ) { | |
/** | |
* Turn on error logging and show errors on-screen if in debugging mode | |
*/ | |
@error_reporting( E_ALL ); | |
@ini_set( 'log_errors', true ); | |
@ini_set( 'log_errors_max_len', '0' ); |
This file contains hidden or 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 rp4wp_title_order_received( $title, $id ) { | |
if ( is_order_received_page() && get_the_ID() === $id ) { | |
global $wp; | |
$order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) ); | |
$order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) ); | |
if ( $order_id > 0 ) { | |
$order = wc_get_order( $order_id ); |
This file contains hidden or 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 bk_title_order_received( $title, $id ) { | |
if ( is_order_received_page() && get_the_ID() === $id ) { | |
$title = "Thank you for your order!"; | |
} | |
return $title; | |
} | |
add_filter( 'the_title', 'bk_title_order_received', 10, 2 ); |