Skip to content

Instantly share code, notes, and snippets.

View salehahmadbabu's full-sized avatar

Saleh Ahmad salehahmadbabu

View GitHub Profile
function add_additional_class_on_a($classes, $item, $args)
{
if (isset($args->menu_anchor_class)) {
$classes['class'] = $args->menu_anchor_class;
}
return $classes;
}
add_filter('nav_menu_link_attributes', 'add_additional_class_on_a', 1, 3);
add_action( 'woocommerce_order_status_changed', 'your_function', 99, 4 );
function your_function( $order_id, $old_status, $new_status, $order ){
if( $new_status == "completed" ) {
var_dump($order);
$user_id = $order->get_user_id();
$user = new WP_User($user_id);
$user->set_role('subscriber');
}
}
add_filter( 'wp_nav_menu_items', 'wbtheme_custom_menu_item', 10, 2 );
function wbtheme_custom_menu_item ( $items, $args ) {
if ( $args->menu == 'Main Menu') {
$items .= '<li><a href="callto:'.get_field('number', 'option').'" class="menu-bttn">'.get_field('number', 'option').'</a></li>';
}
return $items;
}
<script>
;(function($){
$(window).on('load', function(){
var maxHeight = 0,
items = $('.customers-review .swiper-slide');
items.each(function () {
maxHeight = ($(this).height() > maxHeight ? $(this).height() : maxHeight);
});
//Assign maximum height to children
/*create a php file in the root directory, paste these codes and open the file in browser (https://yoursite.com/filename.php)*/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow"/>
<title>Search and replace files</title>
</head>
<body style="margin: 0; padding: 0;">