Skip to content

Instantly share code, notes, and snippets.

View itsmereal's full-sized avatar
👋
Hi there

Al-Mamun Talukder itsmereal

👋
Hi there
View GitHub Profile
@itsmereal
itsmereal / wc-new-account-notify-admin.php
Last active October 30, 2020 17:59 — forked from woogists/wc-new-account-notify-admin.php
[General Snippets] Notify admin when a new customer account is created and user meta data is saved
<?php
/**
* Notify admin when a new customer account is created and user meta data is saved
* So, you can show user meta data like 'billing_phone' in the email
*/
add_action( 'woocommerce_checkout_update_user_meta', 'woocommerce_created_customer_admin_notification' );
function woocommerce_created_customer_admin_notification( $customer_id ) {
wp_send_new_user_notifications( $customer_id, 'admin' );
<?php
// Add a custom menu item with the URL "_SITEURL_/test" and label "[test]" to see it in action
add_filter('wp_nav_menu', 'menu_shortcodes');
function menu_shortcodes( $menu ){
return str_replace('_SITEURL_',preg_replace("~^(?:f|ht)tps?://~i", '', home_url() ), do_shortcode( $menu ) );
}
@itsmereal
itsmereal / functions.php
Last active December 26, 2015 08:19
BuddyPress Notifications Code prepared for drop down menu. Added CSS for simple navigation output
<?php
function bp_notification_badge() {
if ( is_user_logged_in() ) {
echo '<ul class="noti_nav">';
$notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() );