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 | |
add_action( 'acf/will_remove_unsafe_html', 'acf_enable_detailed_escape_logging_to_php_error_log', 10, 4 ); | |
add_action( 'acf/removed_unsafe_html', 'acf_enable_detailed_escape_logging_to_php_error_log', 10, 4 ); | |
function acf_enable_detailed_escape_logging_to_php_error_log( $function, $selector, $field_object, $post_id ) { | |
if ( $function === 'the_sub_field' ) { | |
$field = get_sub_field_object( $selector, true ); | |
$value = ( is_array( $field ) && isset( $field['value'] ) ) ? $field['value'] : false; | |
} else { | |
$value = get_field( $selector, $post_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 | |
add_action( 'acf/will_remove_unsafe_html', 'print_backtrace_for_unsafe_html_removal', 10, 4 ); | |
add_action( 'acf/removed_unsafe_html', 'print_backtrace_for_unsafe_html_removal', 10, 4 ); | |
function print_backtrace_for_unsafe_html_removal( $function, $selector, $field_object, $post_id ) { | |
echo '<h4 style="color:red">Detected Potentially Unsafe HTML Modification</h4>'; | |
echo '<pre>'; | |
debug_print_backtrace(); | |
echo '</pre>'; | |
} |
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
var waitForGlobal = function(key, callback) { | |
if (window[key]) { | |
callback(); | |
} else { | |
setTimeout(function() { | |
waitForGlobal(key, callback); | |
}, 100); | |
} | |
}; | |
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 | |
# Make sure to replace {id} with your form's id | |
add_filter( 'gform_pre_render_{id}', 'my_populate_checkbox' ); | |
function my_populate_checkbox( $form ) { | |
/** | |
* Loop through form fields | |
* |
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
const autoprefixer = require('autoprefixer'); | |
const webpack = require('webpack'); | |
const path = require('path'); | |
const precss = require('precss'); | |
const TransferWebpackPlugin = require('transfer-webpack-plugin'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
module.exports = { | |
devtool: 'eval', |
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
class Intercom { | |
constructor () { | |
this.interval = setInterval(this.checkBootStatus.bind(this), 100) | |
this.timeout = setTimeout(() => { | |
clearInterval(this.interval) | |
}) | |
} | |
checkBootStatus () { | |
if (window.Intercom && window.Intercom.booted) { |