Skip to content

Instantly share code, notes, and snippets.

View janneleppanen's full-sized avatar

Janne Leppänen janneleppanen

  • Jyväskylä, Finland
View GitHub Profile
@danielbachhuber
danielbachhuber / gist:9379135
Created March 5, 2014 23:43
Fix network admin URL to include the "/wp/" base
<?php
/**
* Fix network admin URL to include the "/wp/" base
*
* @see https://core.trac.wordpress.org/ticket/23221
*/
add_filter( 'network_site_url', function( $url, $path, $scheme ){
$urls_to_fix = array(
'/wp-admin/network/',
@solepixel
solepixel / acf-sync-fields.php
Created December 30, 2015 10:20
Sync 2 relationship CPT fields in ACF that are connected. Example: Actors (Relationship Field) in a Movie (CPT), and Movies (Relationship field) an Actor (CPT) has been in.
<?php
function acf_sync_field( $sync_field, $value, $post_id, $field ){
// vars
$source_field = $field['name'];
$source_global_name = 'is_updating_' . $source_field;
$sync_global_name = 'is_updating_' . $sync_field;
// get this value early before anything is updated
@ingozoell
ingozoell / wp-bug-plugin-relevanssi.sql
Last active November 7, 2017 13:23
WP BUG | Plugin: Relevanssi - A Better Search Database Import Problem Stopwords-Table Collation Error https://wordpress.org/support/topic/database-import-problem-stopwords-table-collation-error
[...] utf8_bin =>
[...] utf8mb4_bin