./binary "%08x ...." // ________ ./binary "%#010x..." // 0x________
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 | |
/* $message — Default message to send to Slack | |
$form — Form object | |
$result — Array of result | |
*/ | |
function custom_cf_7( $message, $form, $result ) { | |
return "OK" . json_encode($form) . json_encode($result); // Customize message here | |
} | |
add_filter( 'slack_wpcf7_submit_message', 'custom_cf_7', 10, 3 ); |
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 /* Template Name: Carte */ | |
function page_content() { | |
?> | |
<div class="map"> | |
<?php | |
$args = array( | |
'post_type' => 'poi' | |
); | |
$the_query = new WP_Query( $args ); |
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('use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2); | |
function prefix_disable_gutenberg($current_status, $post_type) { | |
if ($post_type === 'cpt1') return false; | |
if ($post_type === 'cpt2') return false; | |
if ($post_type === 'cpt3') return false; | |
return $current_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
<?php | |
/* Template Name: Test */ | |
/** | |
* Genesis custom loop | |
*/ | |
function be_custom_loop() { | |
global $post; | |
// arguments, adjust as needed |
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 | |
// Hide price for product that costs zero | |
function rohs_hide_zero_price($price_html, $product){ | |
if($product->get_price()>0){ | |
return $price_html; | |
} | |
return ''; | |
} | |
add_filter( 'woocommerce_get_price_html','rohs_hide_zero_price',10,2); | |
?> |
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 | |
/* Disable add to cart for product where price is 0 */ | |
function rohs_is_purchasable( $purchasable, $product ){ | |
if( $product->get_price() == 0 ) | |
$purchasable = false; | |
return $purchasable; | |
} | |
add_filter( 'woocommerce_is_purchasable', 'rohs_is_purchasable', 10, 2 ); | |
?> |
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
/* Import media present on the wp_uploads folder */ | |
// https://codex.wordpress.org/Function_Reference/wp_insert_attachment | |
if($_GET['rohs_run']) { | |
echo 'RUN'; | |
// Get WP uploads dir | |
$wp_upload_dir = wp_upload_dir(); | |
// Init recursive Obj | |
$di = new RecursiveDirectoryIterator($wp_upload_dir['path'], RecursiveDirectoryIterator::SKIP_DOTS); | |
foreach (new RecursiveIteratorIterator($di) as $filename => $file) { |
(python -c "print 'A'*40 + '\xef\xbe\xad\xde'"; cat) | ./bin
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
axios.put(this.apiBaseEndpoint + '/' + id, input) | |
.then((response) => { | |
// Success | |
}) | |
.catch((error) => { | |
// Error | |
if (error.response) { | |
// The request was made and the server responded with a status code | |
// that falls out of the range of 2xx | |
// console.log(error.response.data); |