Skip to content

Instantly share code, notes, and snippets.

View xenioushk's full-sized avatar

Mahbub Alam Khan xenioushk

View GitHub Profile
@xenioushk
xenioushk / check-php-ver-wordpress-admin-notice.php
Last active June 30, 2025 20:40
Check the required PHP Version and display notice
// Define minimum PHP version requirement
// Our required minimum php version is 8.2.10
define( 'BAFIEADDON_MIN_PHP_VERSION', '8.2.10' );
// Check PHP version before loading anything else
if ( version_compare( PHP_VERSION, BAFIEADDON_MIN_PHP_VERSION, '<' ) ) {
add_action( 'admin_notices', function () {
$message = sprintf(
/* translators: 1: Plugin name, 2: Required PHP version, 3: Current PHP version */
esc_html__( '%1$s requires PHP version %2$s or higher. You are running PHP version %3$s. Please upgrade your PHP version.', 'baf-import-export-addon' ),
@xenioushk
xenioushk / gist:a5d5fedbfab5ec3bbb1ce0f9cb0a658c
Created April 29, 2025 05:58
The Secret to Generating Dynamic WordPress Shortcodes (No One Talks About)
// Gather all the shortcode data.
$shortcode_data = [
'tag' => 'bwl_headline',
'title' => "Hello WordPress",
'sub_title' => "Generate dynamic wordpress shortcode.",
];
// Extract the shortcode data.
// For destructuring array data, you can also use the php list function instead of extract.
extract($shortcode_data);
@xenioushk
xenioushk / gist:4fe086db5e1ab2c0ecbed9f691ed2a11
Created October 31, 2024 07:31 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@xenioushk
xenioushk / .phpcs.xml
Created August 31, 2024 20:23 — forked from sarahcssiqueira/.phpcs.xml
Workaround to handle PSR-4 && WordPress Coding Standards at same time
<?xml version="1.0"?>
<ruleset name="CS">
<description>PHPCS example</description>
<config name="testVersion" value="5.6-"/>
<exclude-pattern>vendor/*</exclude-pattern>
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="100"/>
<arg name="extensions" value="php"/>
@xenioushk
xenioushk / wordpress-6-2-2-docker-compose.yml
Created December 3, 2023 18:30 — forked from erikyuzwa/wordpress-6-2-2-docker-compose.yml
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
version: "3.8"
services:
@xenioushk
xenioushk / gist:71cadeb529c5d2f81cb52be4187fb9d3
Last active November 1, 2023 10:14
Stitched Effect Using CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Create a Stitched Effect Using CSS</title>
<style>
.stitched-effect {
padding: 12px;
width: 200px;
<?php
/*
* Get Max and Min Value
* From A PHP Array
* https://youtube.com/bluewindlab
*/
$items = [10, 2, 31, 14, 5];
@xenioushk
xenioushk / gist:5a65654caf33476abdc3d9d5d94e35a4
Created March 25, 2022 23:13
Fibonacci Series | PHP example code
<?php
echo "Expected Output: <br> 0,1,1,2,3,5,8";
echo "<br>";
$start = 0;
$count = 7;
echo "Final Result: <br>";
@xenioushk
xenioushk / gist:b898c9ce4f81c6f0ee2c56146293d244
Created November 16, 2021 08:08
Web Development Popular Acronyms
API = Application Program Interface
ORM = Object Relation Mapping
ODM = Object Document Mapping
@xenioushk
xenioushk / gist:6acaf1dc4578afc96f512d7f2709eec7
Last active November 16, 2021 04:55
Browser console.assert() example
let a = 3;
let b = 4;
console.assert(a == b, {
a: a,
b: b,
errorMsg: a + " is not equal to " + b
})
// More examples:
// https://developer.mozilla.org/en-US/docs/Web/API/console/assert