Skip to content

Instantly share code, notes, and snippets.

@robertuniqid
robertuniqid / filter-proxy.php
Last active May 2, 2017 10:07
Easily attach filters in WordPress, then remove them.
<?php
// This is an PHP Trait http://php.net/manual/ro/language.oop5.traits.php
trait FilterProxy {
protected $_filter_proxy_storage = [];
public function _filter_proxy_setup( $information ) {
if( empty( $information ) )
@robertuniqid
robertuniqid / WPEPAssetMatcher.php
Last active July 10, 2016 23:58
WPEP - Extract Image from different paths within WordPress from JSON data. Can be adapted.
<?php
namespace WPEPAddOnImportExport\Coordinator;
class AssetMatcher {
public $website_url;
public function __construct() {
$this->website_url = get_site_url();
@robertuniqid
robertuniqid / directory-navigation-ftp.php
Created May 9, 2016 20:58
PHP FTP Connection Helper ( including sorting like Filezilla )
<?php
// Not the most optimal solution, but it's the best for the way I need it.
class DirectoryNavigationFTP {
public $connectionEntity;
/**
* @var bool|resource
@robertuniqid
robertuniqid / .js
Created January 25, 2016 22:35
Force in-site iFrames to point to URL's and have an certain suffix or URL Paramter. I've used this to change the layout to a different one, in order to achieve an "Quick Access" Interface for minimal 2-3 inputs tables on a larger project. This is a great alternative if you're also working in Laravel and you want to avoid taking this case into ac…
var Layout = {
_handleSmartIFrameContainers : function() {
var objectInstance = this;
jQuery('[data-smart-iframe]').each(function() {
var smartIFrameContainer = jQuery(this);
jQuery(this).find(jQuery(this).attr('data-smart-iframe')).bind("click", function(event) {
event.preventDefault();
@robertuniqid
robertuniqid / gist:f82c78169afac160efd5
Created June 23, 2015 09:48
WooCommerce - Get Newest Order ID By UserID and Product ID
<?php
global $wpdb;
$query = 'SELECT oinfo.ID
FROM ' . $wpdb->base_prefix . 'woocommerce_order_items as oitem
LEFT JOIN ' . $wpdb->base_prefix . 'posts as oinfo ON oinfo.ID = oitem.order_id
LEFT JOIN ' . $wpdb->base_prefix . 'postmeta as ometa ON ometa.post_id = oinfo.ID AND ometa.meta_key = "_customer_user"
LEFT JOIN ' . $wpdb->base_prefix . 'woocommerce_order_itemmeta as oimeta ON oimeta.order_item_id = oitem.order_item_id
AND oimeta.meta_key = "_product_id"
@robertuniqid
robertuniqid / gist:e020d0e509f6df1d4ccb
Created June 21, 2015 22:44
Easy Development - Template Helper Meith
var TemplateHelper = {
Init : function() {
var objectInstance = this;
this.EventManager.registerEvent('displayMovement');
this.Component.Init(objectInstance);
jQuery(window).bind('resize scroll', function(){