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 / keybase.md
Created October 19, 2023 20:40
keybase

Keybase proof

I hereby claim:

  • I am evgrezanov on github.
  • I am redmonkey73 (https://keybase.io/redmonkey73) on keybase.
  • I have a public key ASDaWBFVw_AvIRylcb7ZcF7O-VoT_nvUUUTyQeUE2NFC0Qo

To claim this, I am signing this object:

@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 / new-user-login-cookie-based-redirect.php
Created February 5, 2021 08:39
New user login redirect, Cookie-based solution
@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
<?php
// https://gist.github.com/evgrezanov/44c03e61ea5a68b5c6ed507f12f57c02
add_action( 'pmxi_saved_post', 'mst_company_jobs_mapping', 10, 1);
function mst_company_jobs_mapping($post_id){
$import_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) );
if ( $import_id == '161' || $import_id == '145') :
global $wpdb;
// choоse table
$is_test = false;
@evgrezanov
evgrezanov / mst_company_jobs_mapping.php
Last active November 22, 2020 10:00
mst_company_jobs_mapping.php
<?php
add_action( 'pmxi_saved_post', 'mst_company_jobs_mapping', 10, 1);
function mst_company_jobs_mapping($post_id){
$import_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) );
if ( $import_id == '161' || $import_id == '145') :
global $wpdb;
// choоse table
$is_test = false;
if ($is_test):
@evgrezanov
evgrezanov / wprss-add-meta-hook.php
Last active October 6, 2020 09:37
Add meta field to wprss aggregator CPT (for mybiglife.com)
<?php
// https://gist.github.com/evgrezanov/2045bef6d5f1f904bef71b2423d62aeb
// add this function to your theme functions.php
// start
add_filter('wprss_ftp_post_meta', 'mybl_custom_post_meta', 10, 4);
function mybl_custom_post_meta($meta, $post_id, $feed_source, $feed_item){
$feed = $feed_item->get_feed();
$date = $feed_item->get_date('Y-m-d');
$meta['!post-type'] = array(
<?php
//filter query before request (company with open jobs, pagination, terms matches)
add_filter( 'wpv_filter_query', 'show_only_hiring_now_companies', 99, 3 );
function show_only_hiring_now_companies( $query_args, $view_settings, $view_id ) {
if ( $view_id == 72 ){
// post per pagination page
$post_per_page = 9;
$query_args['posts_per_page'] = $post_per_page;
function matchCompanies () {
jQuery(document).ready(function ($) {
/* Get founded companies */
let hResultsLi = $("#h-results-ul li");
if (hResultsLi) {
let hResultsLiLength = hResultsLi.length;
@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, $) {