Skip to content

Instantly share code, notes, and snippets.

View certainlyakey's full-sized avatar

Aleksandr Beliaev certainlyakey

  • Nortal AS
  • Tallinn
View GitHub Profile
@certainlyakey
certainlyakey / polylang.php
Last active March 1, 2018 12:15 — forked from qstudio/pll_copy_post_metas.php
Wordpress and Polylang: prevent certain custom fields' values from synchronising between posts in different languages (they always sync by default)
<?php
// We could use wpml-config.xml to turn off the sync, but it wouldn't support repeater-like fields
function themeprefix_dont_sync_specific_fields( $metas ) {
$unsync = array(
'office_country',
'uspage_liftups_repeater'
);
// Support for repeaters, flexible content fields etc.
if ( is_array( $metas ) && is_array( $unsync ) ) {
<?php
/*
Plugin Name: GF file upload to ACF image field
Plugin URI: https://gist.github.com/certainlyakey/8c19791b3133beb62d323bf060bf4270
Description: Map Gravity forms file upload field to ACF image/file field so GF would upload the file and save id to DB instead of URL.
Version: 1.0.0
Author: Kellen Mace
*/
@certainlyakey
certainlyakey / library.scss
Last active August 29, 2015 14:14
Line-height based baseline grid SASS mixin, supports rem and px. Displayed above the page content. Press W to toggle
@function strip-units($number) {
@return $number / ($number * 0 + 1);
}
// Mixins
//requires strip-units function
@mixin baseline-grid($baseline, $line-color-01: #ccc, $line-color-02: transparent) {
$browser-fz-base:16;
@certainlyakey
certainlyakey / lorem.jade
Created February 3, 2015 10:42 — forked from geedmo/lorem.jade
Hipstum ipsum jade mixin
//- ----------------------------------
//- Usage:
//- include lorem
//- p
//- mixin lorem(25)
//- ----------------------------------
//- new sentece after N words
- var colonEvery = 10