Skip to content

Instantly share code, notes, and snippets.

View iqbalrony's full-sized avatar
🏠
Working from home

Iqbal Hossain Rony iqbalrony

🏠
Working from home
View GitHub Profile
@iqbalrony
iqbalrony / wp-cli-commands.txt
Last active September 9, 2022 08:12
WP-CLI Commands which is necessary & most frequently used.
Commands
--------------
Wordpress Download = wp core download
Config.php file create = wp config create --dbname=database_name --dbuser=database_username --dbpass=database_password
Wordpress Install = wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword [email protected]
Theme or Plugin Install = wp theme/plugin install theme_slug/plugin_slug
Theme or Plugin Activate = wp theme/plugin activate theme_slug/plugin_slug
Theme or Plugin Install & Activate = wp theme/plugin install theme_slug/plugin_slug --activate
@iqbalrony
iqbalrony / ruleset.xml
Last active January 6, 2022 11:58
Custom Coding Standards ruleset for WordPress
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="IqbalRony-Custom" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->
<!-- Set a description for this ruleset. -->
<description>IqbalRony Custom Coding Standards</description>
<arg name="parallel" value="8" />
@iqbalrony
iqbalrony / functions.php
Created May 10, 2021 17:04 — forked from sh-sabbir/functions.php
Elementor Widget category re-order
<?php
function add_elementor_widget_categories( $elements_manager ) {
$categories = [];
$categories['oceanic'] =
[
'title' => 'Oceanic Widgets',
'icon' => 'fa fa-plug'
];
@iqbalrony
iqbalrony / do-shortcode-callback.php
Created March 8, 2021 12:11 — forked from obiPlabon/do-shortcode-callback.php
Call a shortcode function by tag name
<?php
/**
* Call a shortcode function by tag name.
*
* @param string $tag The shortcode whose function to call.
* @param array $atts The attributes to pass to the shortcode function. Optional.
* @param array $content The shortcode's content. Default is null (none).
*
* @return string|bool False on failure, the result of the shortcode on success.
*/
@iqbalrony
iqbalrony / most-useful-terminal-command-list.txt
Created September 15, 2020 12:29 — forked from devAsadNur/most-useful-terminal-command-list.txt
A list of most used terminal command list.
=======================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//////////////// Most Useful Terminal Command List \\\\\\\\\\\\\\\\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
=======================================================================
01. Current Working Directory:
@iqbalrony
iqbalrony / elementor-tips-tricks.php
Last active October 16, 2024 09:13
Elementor coding tips tricks. (Exclude & Include example for elementor group control)
<?php
/*
* Exclude & Include in group control
*/
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'item_background',
'label' => __( 'Background', 'happy-addons-pro' ),
'types' => [ 'classic', 'gradient' ],
@iqbalrony
iqbalrony / isInViewport.js
Last active May 14, 2020 07:14
Determine that target element is in viewport or not by vanilla javascript and jQuery. ( view port, in window view, is visible )
( function($){
"use strict";
// By JavaScript
var $target = document.querySelector('.targetClass');
var setPosition = function ($target) {
var docViewHeight = window.innerHeight;
var docViewTop = window.scrollY;
var docViewBottom = docViewTop + docViewHeight;
var eHeight = $target.offsetHeight;
var eTop = $target.offsetTop;
@iqbalrony
iqbalrony / instagram_basic_display_api.php
Last active April 4, 2023 12:30
how to get access token for instagram basic display API
<?php
$endpoint = 'https://api.instagram.com/oauth/access_token';
// params the endpoint requires
$params = array(
'app_id' => 'your Instagram_APP_ID', // our instagram app id
'app_secret' => 'your Instagram_APP_SECRET', // our instagram app secret
'grant_type' => 'authorization_code',
'redirect_uri' => 'your redirect url', // our redirect uri
'code' => $_GET['code'] ? $_GET['code'] : '' // code instagram sent us in the URL
@iqbalrony
iqbalrony / breadcrumbs.php
Last active April 4, 2023 12:30
WordPress Custom Breadcrumbs
/**
* Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user.
*
* @since 0.6.0
* @access public
*/
class Breadcrumb_Trail {
/**
* Array of items belonging to the current breadcrumb trail.
@iqbalrony
iqbalrony / get-local-time.html
Last active January 7, 2020 10:42
Get User Time or Local Time or Client's Device Time By Javascript and PHP
<script>
/**
* The First way to get local time.
*/
//var timeZone = new Date().toString().match(/([A-Z]+[\+-][0-9]+.*)/)[1]; return 'GMT+0600 (Bangladesh Standard Time)'
var pattern = /GMT(.*)\d/;
var GMT = pattern.exec(new Date().toString())[0];
document.cookie = "GMT=" + GMT;
/**