Skip to content

Instantly share code, notes, and snippets.

View AnrietteC's full-sized avatar

Anriëtte Myburgh AnrietteC

  • Amsterdam, Netherlands
View GitHub Profile
protected function populateState($ordering = null, $direction = null)
{
# .... other code here
# Get category filter from menu item, 0 means no filter
$catid = $menu_params->get('show_from_category', 0);
if ($catid)
$this->setState('filter.catid', $catid);
}
@AnrietteC
AnrietteC / arraysetting.php
Created February 2, 2015 15:15
Unset() + redeclare vs. redeclare ONLY
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$array_length = 800000;
$test_array = [];
for ($i = 0; $i < $array_length; $i++) {
@AnrietteC
AnrietteC / intuitive-custom-post-order.php
Created September 24, 2014 06:04
Intuitive Custom Post Order: manual fix to unwanted ordering
<?php
/*
Plugin Name: Intuitive Custom Post Order
Plugin URI: http://hijiriworld.com/web/plugins/intuitive-custom-post-order/
Description: Intuitively, Order Items (Posts, Pages, and Custom Post Types) using a Drag and Drop Sortable JavaScript.
Version: 2.1.0
Author: hijiri
Author URI: http://hijiriworld.com/web/
*/