Skip to content

Instantly share code, notes, and snippets.

View banarsiamin's full-sized avatar
💭
happy

banarsiamin banarsiamin

💭
happy
View GitHub Profile
@banarsiamin
banarsiamin / zipextractor.php
Created May 25, 2017 12:45
zip file extractor in php to current folder
<?php
$zip=new ZipArchive;
$res=$zip->open('softhub.zip');
if($res===TRUE)
{
$zip->extractTo('./');
$zip->close();
echo'woot!';
}else{
echo'doh!';
@banarsiamin
banarsiamin / script.php
Created June 9, 2021 12:35 — forked from vielhuber/script.php
get current language (with locale) #wpml #wordpress
<?php
// returns 'en'
apply_filters( 'wpml_current_language', NULL );
// returns 'en'
global $sitepress;
$lang = $sitepress->get_current_language();
// returns 'en' (deprecated, does also not work when you switched languages programmatically)
if(defined('ICL_LANGUAGE_CODE')) {
@banarsiamin
banarsiamin / elementor-tab-close.js
Last active June 12, 2024 13:49
How to Set the Elementor Accordion Widget Closed by Default
jQuery(document).ready(function($) {
var delay = 100; setTimeout(function() {
$('.elementor-tab-title').removeClass('elementor-active');
$('.elementor-tab-content').css('display', 'none'); }, delay);
});
@banarsiamin
banarsiamin / font-awesome.php
Last active December 14, 2023 10:05
PHP array of Font Awesome icons.
<?php
// Font Awesome v. 4.6.
function php_array_list_font_awesome_icons() {
return array(
'fa-glass' => '\f000',
'fa-music' => '\f001',
'fa-search' => '\f002',
'fa-envelope-o' => '\f003',
@banarsiamin
banarsiamin / wp-function.php
Last active February 1, 2024 15:11
Elemntor for with Hubspot leade insert in wp php
<?php
add_action( 'elementor_pro/forms/new_record', function( $record, $ajax_handler ) {
$form_name = $record->get_form_settings( 'form_name' );
$data = aytHubspotForm();
$ajax_handler->add_response_data( 'hubspot_data', $data );
}, 10, 2);
function aytHubspotForm($data=array()){
//echo"<PRE>";print_r($_REQUEST);die;
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
<?php
/*
Plugin Name: Custom post search by text,category,tags And ACf fields
Plugin URI: https://p8ls.de
description: Dynamic search having Custom post type, category, tags And ACf fields [post_with_filter_form]
Version: 1.0.0
Author: BNARSIAMIN
Text Domain: ayt_cps
Author URI: https://google.com
License: GPL2
@banarsiamin
banarsiamin / geocode.php
Created December 12, 2023 12:59
Google Maps API Show Marker using address or coordinates
<!DOCTYPE html>
<html>
<head>
<title>Geocode with Google Maps</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@banarsiamin
banarsiamin / function.php
Created December 14, 2023 10:02
Short info Meta Box repeater field for product in custom wordpress
<?php // Add meta box
function akbcustom_meta_box() {
add_meta_box(
'akbcustom_meta_box', // Unique ID
'Short info Meta Box', // Box title
'display_akbcustom_meta_box', // Callback function to display the meta box
'product', // Post type(s) to display the meta box
'normal', // Context (normal, advanced, side)
'high' // Priority (high, core, default, low)
);
<?php
/*
*
* Description: Simplified and faster WooCommerce Set Single Currency with live echenge
* Author: banarsiamin
* Author URI: https://www.ayatinfotech.com
* Version: 1.0.0
*/
if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
@banarsiamin
banarsiamin / ubuntu-xampp
Last active March 1, 2024 06:25
Instal ubuntu-xampp
sudo -s
apt update
apt upgrade
wget chmod +x xampp-linux-x64-8.2.12-0-installer.run
chmod +x xampp-linux-x64-8.2.12-0-installer.run
./xampp-linux-x64-8.2.12-0-installer.run
#In order to start all the xampp services, we need to run the following command in the terminal:
/opt/lampp/xampp start
/opt/lampp/xampp stop