Skip to content

Instantly share code, notes, and snippets.

View reandimo's full-sized avatar
🎯
Focusing on creating things.

Renan Diaz reandimo

🎯
Focusing on creating things.
View GitHub Profile
@MatthewEppelsheimer
MatthewEppelsheimer / country-shortcode.php
Last active February 27, 2023 11:44
WP Contact Form 7 shortcode with list of Countries
<?php
/*
Localizations:
- [Spanish](https://gist.github.com/MatthewEppelsheimer/1498955#gistcomment-3317461) props @chdgp
UPDATED: 2020-03-09
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@umidjons
umidjons / index.html
Last active January 6, 2024 18:46
Upload File using jQuery.ajax() with progress support
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload File using jQuery.ajax() with progress support</title>
</head>
<body>
<input type="file" name="file" id="sel-file"/>
@vividvilla
vividvilla / sale-flash.php
Last active October 18, 2018 10:10
Display Discount/Offer percentage in WooCommerce
<?php
/**
* Product loop sale flash
*
* @author Vivek R @ WPSTuffs.com
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@paulund
paulund / example-wp-list-table.php
Last active May 20, 2024 05:29
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@bcamarneiro
bcamarneiro / Single Value from mysqli PHP.php
Created April 22, 2014 15:14
Return single value from mysqli PHP
$name = $mysqli->query("SELECT name FROM contacts WHERE id = 5")->fetch_object()->name;
@gbot
gbot / woocommerce-login-logout-redirects.php
Last active November 16, 2021 10:11
WP: Redirect to home page for WooCommerce login and logout. #ST3
/*----------------------------------------------------------------------------*/
// redirects for login / logout
/*----------------------------------------------------------------------------*/
add_filter('woocommerce_login_redirect', 'login_redirect');
function login_redirect($redirect_to) {
return home_url();
}
@JeroenSormani
JeroenSormani / woocommerce-custom-order-action.php
Last active September 11, 2023 17:02
Add a new action to the order action drop down
add_action('woocommerce_order_actions', 'custom_wc_order_action', 10, 1 );
function custom_wc_order_action( $actions ) {
if ( is_array( $actions ) ) {
$actions['custom_action'] = __( 'My custom action' );
}
return $actions;
}
@hal0gen
hal0gen / _mobile-ready-web-app.html
Last active May 12, 2024 08:35 — forked from tfausak/ios-8-web-app.html
iOS + Android settings for web applications
<!doctype html>
<!-- Adapted from https://gist.github.com/tfausak/2222823 -->
<html>
<head>
<title>Mobile-ready web app</title>
<!-- CONFIGURATION -->
@JeroenSormani
JeroenSormani / woocommerce-dont-apply-discount-on-sale-items.php
Created February 2, 2016 12:50
Don't apply coupon codes to sale products
<?php
function custom_wc_coupon_validity( $valid, $product, $this, $values ) {
if ( $product->is_on_sale() ) {
return false;
}
return $valid;
}