Skip to content

Instantly share code, notes, and snippets.

View evgrezanov's full-sized avatar
:octocat:
Working from home

Evgeniy Rezanov evgrezanov

:octocat:
Working from home
View GitHub Profile
@evgrezanov
evgrezanov / add-taxonomy-to-woocommerce-export.php
Created April 30, 2021 19:56 — forked from helgatheviking/add-taxonomy-to-woocommerce-export.php
Add a custom taxonomy to WooCommerce import/export
<?php
/*
* Plugin Name: WooCommerce Add Taxonomy to Export
* Plugin URI: https://gist.github.com/helgatheviking/114c8df50cabb7119b3c895b1d854533/
* Description: Add a custom taxonomy to WooCommerce import/export.
* Version: 1.0.1
* Author: Kathy Darling
* Author URI: https://kathyisawesome.com/
*
* Woo: 18716:fbca839929aaddc78797a5b511c14da9
@evgrezanov
evgrezanov / code-review-checklist.md
Created January 8, 2021 05:35 — forked from nerandell/code-review-checklist.md
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@evgrezanov
evgrezanov / select2-cascade.js
Created May 16, 2020 18:19 — forked from ajaxray/ select2-cascade.js
Making Select2 (4.x) list boxes cascading / dependent. Options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box.
/**
* A Javascript module to loadeding/refreshing options of a select2 list box using ajax based on selection of another select2 list box.
*
* @url : https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31
* @auther : Anis Uddin Ahmad <anis.programmer@gmail.com>
*
* Live demo - https://codepen.io/ajaxray/full/oBPbQe/
* w: http://ajaxray.com | t: @ajaxray
*/
var Select2Cascade = ( function(window, $) {
@evgrezanov
evgrezanov / example.js
Created January 18, 2020 11:02 — forked from aiiddqd/example.js
Universal Ajax Form handler by vanilla JavaScript
FormAjax('#loginform', 'sb/v1/user/signin');
@evgrezanov
evgrezanov / Car.php
Created November 30, 2019 13:44 — forked from jgrossi/Car.php
How to use Eloquent (from Laravel) inside Wordpress
<?php // File location: /wp-content/themes/my-theme/src/Models/
namespace App\Models;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Car extends Eloquent
{
protected $table = 'cars';
protected $primaryId = 'id';
@evgrezanov
evgrezanov / change_link.php
Last active July 11, 2019 18:38 — forked from igorbenic/change_link.php
Custom WordPress Rewrite Rule to Combine Taxonomy and Post Type | www.ibenic.com/custom-wordpress-rewrite-rule-combine-taxonomy-post-type
@evgrezanov
evgrezanov / userlogingenerate.php
Created August 9, 2018 12:06 — forked from aiiddqd/userlogingenerate.php
Generate user login in WordPress - function example
<?php
/**
* Generate login for new WP user
*
* return string uniq login
*/
function generate_new_userlogin(){
$users_ids = get_users('fields=ID&number=3&orderby=registered&order=DESC');
$last_id = max($users_ids);
@evgrezanov
evgrezanov / functions.php
Created October 3, 2017 02:37 — forked from fldtrace/functions.php
Better, Faster, Responsive Images for Divi – Upload in Divi child theme.
<?php
// enable divi functions
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
//add 1440px image size
add_image_size('image_1440', 1440, 9999, false);
@evgrezanov
evgrezanov / wp_get_object_terms_exclude_filter.php
Created August 9, 2017 01:23 — forked from dan-westall/wp_get_object_terms_exclude_filter.php
Allowing wp_get_object_terms to exclude terms with a filter.
<?php
///////Example usage//////////
//get object terms for $post->ID with taxonomies categories and tags,
//args set as fields all and exclude term with id 1
$terms = wp_get_object_terms(
$post->ID,
array(
@evgrezanov
evgrezanov / yoast-seo-sitemap.php
Created April 30, 2017 18:31 — forked from mohandere/yoast-seo-sitemap.php
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?php
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
// Add custom index