Skip to content

Instantly share code, notes, and snippets.

View EdgarWanjalaWafula's full-sized avatar

Edgar Wanjala EdgarWanjalaWafula

View GitHub Profile
@EdgarWanjalaWafula
EdgarWanjalaWafula / axios.js
Created April 13, 2024 21:51 — forked from ariona/axios.js
Authenticate WooCommerce RestAPI with oAuth 1.0a
import OAuth from 'oauth-1.0a';
import CryptoJS from 'crypto-js';
// Consumer Key
const ck = "ck_c7796f3a7c4eaedde188c78107cd907a41944ac6";
// Consumer Secret
const cs = "cs_d7a23c04e4c1939fb38fd966ea16be0dced185de";
const oauth = OAuth({
@EdgarWanjalaWafula
EdgarWanjalaWafula / readme.md
Created May 1, 2021 10:45 — forked from hitautodestruct/readme.md
Generate a custom structure for Wordpress menus.

This gist is for showing an example of a custom wordpress menu.

If you want to get more from the menu item simply have a look at the $item object. i.e:

// Will return a large object with lots of props like title, url, description, id etc.
var_dump( $item );

This code works on Wordpress 4.1.1 as of 31st of March 2015

@EdgarWanjalaWafula
EdgarWanjalaWafula / get-woocommerce-categories.php
Created July 28, 2019 23:09 — forked from rajeebbanstola/get-woocommerce-categories.php
Simple way to fetch WooCommerce Categories with Image and Description
<?php
$get_featured_cats = array(
'taxonomy' => 'product_cat',
'orderby' => 'name',
'hide_empty' => '0',
'include' => $cat_array
);
$all_categories = get_categories( $get_featured_cats );
$j = 1;