Skip to content

Instantly share code, notes, and snippets.

View EricBusch's full-sized avatar

Eric Busch EricBusch

  • Owen Sound, Ontario
View GitHub Profile
@EricBusch
EricBusch / functions.php
Last active November 6, 2022 11:05
Adding items to a WordPress menu dynamically. http://www.datafeedr.com/?p=1639
<?php
/**
* Adds a link to the Primary Menu based on the
* user's logged in status. This is to be placed
* in your theme's functions.php file or in your
* own plugin file.
*
* This example works for the WordPress Twenty-
* Twelve theme.
@EricBusch
EricBusch / functions.php
Created March 3, 2013 17:39
Create your own WordPress Permalink shortcode.
<?php
/**
* Creates a shortcode that links to other
* content on your site.
*/
function my_permalink_shortcode($atts) {
// Check that $id exists.
$id = intval($atts['id']);
@EricBusch
EricBusch / post.html
Last active November 6, 2022 11:05
Sample post.
Suspendisse dapibus varius adipiscing. Ut at sem sed leo molestie
vehicula et eu enim. Vestibulum augue nibh, fermentum sit amet lobortis
in, <a href="http://www.mysite.com/blog/post-name">vehicula</a> in mi.
Mauris rutrum, eros vitae facilisis ultricies, sapien mauris bibendum
libero, vitae molestie elit risus ac orci.
Suspendisse dapibus varius adipiscing. Ut at sem sed leo molestie
vehicula et eu enim. Vestibulum augue nibh, fermentum sit amet lobortis
in, <a href="[pl id='123']">vehicula</a> in mi.
Mauris rutrum, eros vitae facilisis ultricies, sapien mauris bibendum
libero, vitae molestie elit risus ac orci.
Suspendisse dapibus varius adipiscing. Ut at sem sed leo molestie
vehicula et eu enim. Vestibulum augue nibh, fermentum sit amet lobortis
in, [pl id='123' link='1'] in mi.
Mauris rutrum, eros vitae facilisis ultricies, sapien mauris bibendum
libero, vitae molestie elit risus ac orci.
Suspendisse dapibus varius adipiscing. Ut at sem sed leo molestie
vehicula et eu enim. Vestibulum augue nibh, fermentum sit amet lobortis
in, [pl id='123' link='1' title='link to me'] in mi.
Mauris rutrum, eros vitae facilisis ultricies, sapien mauris bibendum
libero, vitae molestie elit risus ac orci.
EXAMPLE:
[pl id='33']
RETURNS:
http://wwww.mysite.com/hello-world
-----------------------------------------------------------------
EXAMPLE:
<a href="[pl id='33']">read me</a>
<?php
$search = $api->searchRequest();
$search->addFilter('ANY LIKE shoes');
$products = $search->execute();
$networks = $search->getNetworks();
print_r($networks);
<?php
$search = $api->searchRequest();
$search->addFilter('ANY LIKE shoes');
$products = $search->execute();
$merchants = $search->getMerchants();
print_r($merchants);
<?php
$search = $api->searchRequest();
$search->addFilter('ANY LIKE shoes');
$search->setPriceGroups(3);
$products = $search->execute();
print_r( $search->getPriceGroups() );