Skip to content

Instantly share code, notes, and snippets.

@barrykooij
barrykooij / pc-example.php
Created June 5, 2014 07:59
Post Connector Example: Display linked posts of current post
<?php
// Get the connected posts
$my_connected_posts = Post_Connector::API()->get_children( "course", get_the_id() );
// Check
if ( count( $my_connected_posts ) > 0 ) {
// Loop
foreach ( $my_connected_posts as $my_connected_post ) {
@EricBusch
EricBusch / replace-buy-button-with-more-details.php
Created January 22, 2014 15:35
Replaces "Buy" button with "More Details" button on list of products (WooCommerce). For example on category pages.
<?php
/**
* Removes the "Buy" button from list of products (ex. category pages).
*/
add_action( 'woocommerce_after_shop_loop_item', 'mycode_remove_add_to_cart_buttons', 1 );
function mycode_remove_add_to_cart_buttons() {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
}
@oskansavli
oskansavli / DecimalFormat.js
Created February 11, 2011 14:03
Javascript number formatter (Java DecimalFormat Implemented in Javascript)
/**
* @class DecimalFormat
* @constructor
* @param {String} formatStr
* @author Oskan Savli
*/
function DecimalFormat(formatStr)
{
/**
* @fieldOf DecimalFormat