Skip to content

Instantly share code, notes, and snippets.

View RoOLeary's full-sized avatar

Ro_OLeary RoOLeary

View GitHub Profile
@RoOLeary
RoOLeary / mongodb_cheat_sheet_2022.md
Created February 13, 2024 22:06 — forked from codeSTACKr/mongodb_cheat_sheet_2022.md
MongoDB Cheat Sheet 2022
{% if craft.request.isAjax %}
{% set layout = "_ajaxLayout" %}
{% else %}
{% set layout = "_layout" %}
{% endif %}
{% extends layout %}
{% set limit = 10 %}
{% set params = { section: 'news', limit: limit} %}
@RoOLeary
RoOLeary / passUTM.js
Created February 21, 2018 08:35 — forked from dillansimmons/passUTM.js
Pass current UTMS to in page links Javascript
// JS for grabbing utm params and parsing into url
var getRefQueryParam = function() {
var temp = {};
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function() {
var decode = function(s) {
return decodeURIComponent(s.split("+").join(" "));
};
temp[decode(arguments[1])] = decode(arguments[2]);
});
return temp;
@RoOLeary
RoOLeary / filter-posts-mt.php
Created October 19, 2017 23:29 — forked from Bobz-zg/filter-posts-mt.php
Filter WordPress posts by multiple custom taxonomy terms with AJAX Raw
<?php
/**
* AJAC filter posts by taxonomy term
*/
function vb_filter_posts_mt() {
if( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'bobz' ) )
die('Permission denied');
/**
@RoOLeary
RoOLeary / class-developer-import.php
Created September 28, 2017 11:10 — forked from tomazzaman/class-developer-import.php
Import JSON into WordPress
<?php
// Published under GPL
// tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/
class Developer_Import {
public function __construct() {
add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) );
function custom_query_shortcode($atts) {
// EXAMPLE USAGE:
// [loop the_query="showposts=100&post_type=page&post_parent=453"]
// Defaults
extract(shortcode_atts(array(
"the_query" => ''
), $atts));