Skip to content

Instantly share code, notes, and snippets.

View banarsiamin's full-sized avatar
💭
happy

banarsiamin banarsiamin

💭
happy
View GitHub Profile
<?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
@vielhuber
vielhuber / script.php
Last active January 13, 2023 10:46
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 / 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!';
@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active June 13, 2024 15:42 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {