Skip to content

Instantly share code, notes, and snippets.

View mroncetwice's full-sized avatar

Jonathan Mills mroncetwice

View GitHub Profile
@johnkolbert
johnkolbert / gist:769160
Created January 7, 2011 05:45
Unregisters a post type and removes the menu item
<?php
/*
* Usage for a custom post type named 'movies':
* unregister_post_type( 'movies' );
*
* Usage for the built in 'post' post type:
* unregister_post_type( 'post', 'edit.php' );
*/
function unregister_post_type( $post_type, $slug = '' ){
@jonathonbyrdziak
jonathonbyrdziak / example.php
Created February 22, 2012 02:27
Wordpress Metabox, stand alone class for multiple metabox abilities
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
@krogsgard
krogsgard / woo-loop-image-wrap.php
Created June 29, 2012 03:51
WooCommerce insert wrapper around thumbnail images in loop
<?php
/* This snippet removes the action that inserts thumbnails to products in teh loop
* and re-adds the function customized with our wrapper in it.
* It applies to all archives with products.
*
* @original plugin: WooCommerce
* @author of snippet: Brian Krogsard
*/
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
@O-Zone
O-Zone / transitionEnd.js
Last active November 23, 2023 22:43
Get the name of the browsers transitionEnd event. After calling this, window.transitionEnd will contain the browser specific name of the transitionEnd event. This is an extract of EvandroLG's transitionEnd snippet, without all support for testing different elements and using cache.
(function (window) {
var transitions = {
'transition': 'transitionend',
'WebkitTransition': 'webkitTransitionEnd',
'MozTransition': 'transitionend',
'OTransition': 'otransitionend'
},
elem = document.createElement('div');
for(var t in transitions){
@DevinWalker
DevinWalker / content-product.php
Last active September 19, 2021 23:09
Correct WooCommerce hooks for Total theme template override: woocommerce/content-product.php
<?php
/**
* The template for displaying product content within loops.
*
* Override this template by copying it to yourtheme/woocommerce/content-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
@azizultex
azizultex / Getting All Contact Form 7 Forms in a Select Option and Showing Selected Form Anywhere Wordpress
Created February 25, 2015 15:20
Getting All Contact Form 7 Forms in a Select Option and Showing Selected Form Anywhere Wordpress
// This is how I listed the forms in Piklist Select Option below:
$args = array('post_type' => 'wpcf7_contact_form', 'posts_per_page' => -1);
$cf7Forms = get_posts( $args );
// $post_ids = wp_list_pluck( $cf7Forms , 'ID' );
$form_titles = wp_list_pluck( $cf7Forms , 'post_title' );
piklist('field', array(
'type' => 'group'
,'field' => 'contact_form'
@XLNCs
XLNCs / AdobeFixAMD
Last active November 14, 2024 11:08
To fix adobe products crashes on AMD hackintosh
MOVED HERE:
https://gist.github.com/naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd