Skip to content

Instantly share code, notes, and snippets.

@ChuckMac
ChuckMac / WordPress Plugin Activation Dependency Check
Created January 25, 2013 17:51
WordPress plugin depency check. Check if another plugin is installed before allowing yours to be installed
/**
* Activation Class
**/
if ( ! class_exists( 'WC_CPInstallCheck' ) ) {
class WC_CPInstallCheck {
static function install() {
/**
* Check if WooCommerce & Cubepoints are active
**/
if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ||
@ChuckMac
ChuckMac / WordPress Page-Post Linking Shortcode
Last active October 24, 2017 13:46
Simple WordPress shortcode for adding dymanic links to pages/posts
[pagelink page="8" title="Link Title" class="link-class"]