Skip to content

Instantly share code, notes, and snippets.

View zeshanshani's full-sized avatar
🎯
Focusing

Zeshan Ahmed zeshanshani

🎯
Focusing
View GitHub Profile
@marklchaves
marklchaves / disable-popup-maker-if-using-divi-builder.php
Last active January 19, 2023 11:13
Disable Popup Maker if Using Divi Builder
<?php // Ignore this first line when copying to your child theme's functions.php file.
/**
* Disable Popup Maker if Using Divi Builder
*
* Reference https://github.com/stefanoferrario/Extra/blob/e5eb5b20e6165ee989b8538f8eebbcddd24ce4b7/core/functions.php#L353
*/
add_action( 'wp', function() {
if ( ! function_exists( 'et_core_is_fb_enabled' ) ) return;
@enriquemorenotent
enriquemorenotent / VS Code extensions and settings
Last active August 17, 2023 10:55
My favorite extensions and settings for Visual Studio Code
Extensions
==========
ext install wakatime.vscode-wakatime (time tracking)
ext install esbenp.prettier-vscode (prettifier)
ext install ms-vscode.csharp (C#)
ext install mikestead.dotenv (.env files)
ext install msjsdiag.debugger-for-chrome (chrome's debugger)
ext install deerawan.vscode-faker (faker)
ext install ms-vsliveshare.vsliveshare (shared coding sessions)
Add the following to your `functions.php`
```php
function vc_before_init_actions() {
require_once( get_template_directory().'/functions/shortcodes/vc-text-image.php' );
}
add_action( 'vc_before_init', 'vc_before_init_actions' );
```
And now create a file in the location specified above with the following (customise accordingly):
<?php
/*
################### READ ME #################################
You'll pass the URL to your feed/file to this function inside the "Download from URL" option when creating an import.
Image examples: https://d.pr/hCfNek and https://d.pr/MnerNb.
1. [custom_file_download("ftp://username:password@hostname.com/full/path/to/file.csv","csv")]
2. [custom_file_download("http://example.com/full/path/to/file.csv","csv")]
@prasetyop
prasetyop / admin.css
Last active March 13, 2023 13:33
Flexible Content Preview Pop Up
.acf-fc-popup .preview {
position: absolute;
right: 100%;
margin-right: 0px;
top: 0;
background: #383c44;
min-height: 100%;
border-radius: 5px;
align-content: center;
display: grid;
@zeshanshani
zeshanshani / html.json
Last active September 21, 2020 12:44
Expand PHP conditionals in HTML in VS Code.
{
// ECHO
"PHP Echo Tag": {
"prefix": "echo",
"body": [
"<?php echo ${1:\\$var}; ?>"
],
"description": "Expand \"echo\" into PHP echo block"
},
<div id="container">
<?php
// simple but effective for string outputting to html page
function esc($s){
return htmlentities(trim($s), ENT_QUOTES, 'UTF-8');
}
function countFolder($dir) {
$get = (count(scandir($dir)) - 2);
if ($get == -2) {
<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by craig@123marbella.com on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@ben-heath
ben-heath / acf-featured-image-workaround.php
Created November 2, 2016 18:24
Save value of ACF form field to the featured image of the post.
@zeshanshani
zeshanshani / acf_options_multilingual.php
Last active October 10, 2023 11:25
Creates separate Advanced Custom Fields options pages for the specified languages.
<?php // Don't copy this line if you are inserting in a file that has it already.
/**
* ACF Options Page
*
* Instructions:
* Add more languages to the array below: $languages
*
* @author: Zeshan Ahmed <https://zeshanahmed.com/>
*/