Skip to content

Instantly share code, notes, and snippets.

—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
@chillbits-legacy
chillbits-legacy / flattern.php
Created January 27, 2016 19:22
Convert multi dimension array to 1 dimension array
<?php
/**
* Convert multi dimension array to 1 dimension array. Use this function when you need to convert
* wpdb results array to one dimension array
*
* @since 1.4.1
* @return string
*/
function flatten($v) {
if(count($v, COUNT_RECURSIVE) !== count($v)) {
@chillbits-legacy
chillbits-legacy / your-plugin-main-file.php
Last active January 27, 2016 18:56
Multiple categories rewrite rules in WordPress. Example: /cat/child-cat/grandchild-cat/cpt-name/
<?php
class Your_Plugin {
/**
* Post Type slug modification
*
* @since 1.0.0
* @return null
*/
function modifySlug($link, $post)
{