Skip to content

Instantly share code, notes, and snippets.

View magnetoid's full-sized avatar
🏠
Working from home

Marko Tiosavljevic magnetoid

🏠
Working from home
View GitHub Profile
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-EXAMPLE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-EXAMPLE');
{% if first_time_accessed %}
gtag("event", "purchase", {
transaction_id: "{{ order.order_number }}",
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-EXAMPLE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag()
gtag('js', new Date());
gtag('config', 'G-EXAMPLE');
</script>
@magnetoid
magnetoid / new-user-registred-disable.php
Last active July 17, 2021 18:36
New User registred disable in WordPress
<?php
//Disable the new user notification sent to the site admin
function smartwp_disable_new_user_notifications() {
//Remove original use created emails
remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 );
//Add new function to take over email creation
add_action( 'register_new_user', 'smartwp_send_new_user_notifications' );
add_action( 'edit_user_created_user', 'smartwp_send_new_user_notifications', 10, 2 );