Skip to content

Instantly share code, notes, and snippets.

@rjekic
rjekic / gist:9502ba4589097cd27f770ea50d7d6aab
Created April 12, 2020 14:42 — forked from thegdshop/gist:3171026
WooCommerce - Add checkbox field to the checkout
<?php
/**
* Add checkbox field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my-new-field"><h3>'.__('My Checkbox: ').'</h3>';
@rjekic
rjekic / breadcrumbs-list.php
Created April 11, 2020 15:35 — forked from doubleedesign/breadcrumbs-list.php
Mark up Yoast breadcrumbs as an unordered list
<?php
/**
* Filter the output of Yoast breadcrumbs so each item is an <li> with schema markup
* @param $link_output
* @param $link
*
* @return string
*/
function doublee_filter_yoast_breadcrumb_items( $link_output, $link ) {
@rjekic
rjekic / wp.sh
Last active June 16, 2022 12:18 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script using wp-cli
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
# Gathering database login credentials from user input
read -p "Database Host: " dbhost
read -p "Database Name: " dbname
read -p "Database User: " dbuser
@rjekic
rjekic / register-post-type.php
Created September 30, 2019 19:05 — forked from justintadlock/register-post-type.php
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public