Skip to content

How to Debug and Log to the Browser Console in PHP

Just create this simple function and use the console for debugging and logging PHP. function debug_to_console( $data ) { $output = $data; if ( is_array( $output ) ) { $output = implode( ',', $output); } echo "<script>console.log( 'Debug Objects: "…

Mehr Lesen

GDPR – Prevent WordPress fromn sending unnecessary data on core updates

Stop WordPress sending anything but essential data during the update check function wp_update_privacy( $query ) { unset($query['php']); unset($query['mysql']); unset($query['local_package']); unset($query['blogs']); unset($query['users']); unset($query['multisite_enabled']); unset($query['initial_db_version']); return $query; } add_action( 'core_version_check_query_args', 'wp_update_privacy' );

Mehr Lesen

WooCommerce GDPR – Do not store IP for orders

Snippet to clear customer IP address when order is sent in WooCommerce add_action( 'woocommerce_checkout_update_order_meta', 'wc_delete_customer_ip', 1 ); function wc_delete_customer_ip( $order_id ) { update_post_meta( $order_id, '_customer_ip_address', 0 ); } Stop customer IP from being saved in orders in WooCommerce add_filter( 'update_post_metadata',…

Mehr Lesen

How to properly enqueue JQuery UI in WordPress

Wordpress comes along woth many JQuery libraries that are for performance reasons obviously not entirely loaded. But what it you want a custom script to use some of the elements. Then it would be great to use the basic package…

Mehr Lesen
An den Anfang scrollen