Skip to content

Instantly share code, notes, and snippets.

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

Salman Ahmed salmancreation

🏠
Working from home
View GitHub Profile
@akshuvo
akshuvo / woocommerce-settings-tab-demo.php
Created February 25, 2020 22:11 — forked from BFTrick/woocommerce-settings-tab-demo.php
A plugin demonstrating how to add a WooCommerce settings tab.
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@igorbenic
igorbenic / elementor-widget.php
Last active April 11, 2024 09:12
Ultimate Guide for JavaScript in Elementor Widgets
<?php
/**
* Plugin Name: Elementor Widget
* Text Domain: elementor-widget
* Domain Path: /languages
* Version: 0.1.0
*
* @package Elementor_Widget
*/
@iqbalrony
iqbalrony / custom-icon-add-to-elementor.php
Last active April 4, 2023 12:31
Adding custom icon to icon control in Elementor.
<?php
/**
* Adding custom icon to icon control in Elementor
*/
function modify_icon_controls($controls_registry) {
//3696 material design icon classes
$material_design_icons_cls = 'mdi mdi-access-point, mdi mdi-access-point-network, mdi mdi-access-point-network-off, mdi mdi-account, mdi mdi-account-alert, mdi mdi-account-alert-outline, mdi mdi-account-arrow-left, mdi mdi-account-arrow-left-outline, mdi mdi-account-arrow-right, mdi mdi-account-arrow-right-outline, mdi mdi-account-badge, mdi mdi-account-badge-alert, mdi mdi-account-badge-alert-outline, mdi mdi-account-badge-horizontal, mdi mdi-account-badge-horizontal-outline, mdi mdi-account-badge-outline, mdi mdi-account-box, mdi mdi-account-box-multiple, mdi mdi-account-box-outline, mdi mdi-account-card-details, mdi mdi-account-card-details-outline, mdi mdi-account-check, mdi mdi-account-check-outline, mdi mdi-account-child, mdi mdi-account-child-circle, mdi mdi-account-circle, mdi mdi-account-circle-outline, mdi mdi-account-clock, mdi mdi-account-clock-
@giansalex
giansalex / .bashrc
Last active May 26, 2020 23:01
Git Commands Alias
alias gs='git status'
alias ga='git add'
alias gl='git pull'
alias gp='git push'
alias gc='git clone'
alias gck='git checkout'
alias ga='git add'
alias grh='git reset HEAD~1'
alias gm='git merge'
alias gcm='git commit -m '
@kamalahmed
kamalahmed / fix-svg-upload-error-in-wordpress.php
Last active October 3, 2023 13:16
Fix the “Sorry, this file type is not permitted for security reasons.” issue on WordPress while uploading an SVG file
<?php
/**
* A workaround for upload validation which relies on a PHP extension (fileinfo) with inconsistent reporting behaviour.
* ref: https://core.trac.wordpress.org/ticket/39550
* ref: https://core.trac.wordpress.org/ticket/40175
*/
function prefix_filter_fix_wp_check_filetype_and_ext( $data, $file, $filename, $mimes ) {
if ( ! empty( $data['ext'] ) && ! empty( $data['type'] ) ) {
return $data;
}
@kamalahmed
kamalahmed / set-default-fonts-in-elementor-from-theme-or-plugin.php
Last active February 6, 2024 14:54
Update or Set new default fonts in Elementor from your plugin or theme
<?php
add_action('elementor/loaded', 'prefix_register_custom_default_fonts');
// register custom fonts only when elementor is ready
function prefix_register_custom_default_fonts(){
$new_default_fonts = [
//Primary Headline
[
<?php
if(!function_exists('wc_get_products')) {
return;
}
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$ordering = WC()->query->get_catalog_ordering_args();
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby']));
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby'];
@TANVIRFAZLEY
TANVIRFAZLEY / tab.php
Created December 16, 2016 18:22
Tab dynamic in wordpress
/*DEMO*/
<div id="tab">
<ul class="nav nav-tabs" role="tablist">
<?php $loop = new WP_Query( array( 'post_type' => 'candidates', 'posts_per_page' => -1 ) ); ?>
<?php
$counter = 0;
while ( $loop->have_posts() ) : $loop->the_post();
$counter++;
@drabbytux
drabbytux / Magnific Popup CSS
Last active June 2, 2022 22:36
MFP (Magnific Popup) CSS extras
/*================ Vendor-specific styles ================*/
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1042;
overflow: hidden;
position: fixed;
@magicznyleszek
magicznyleszek / css-selectors.md
Last active March 29, 2024 01:12
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {