Skip to content

Instantly share code, notes, and snippets.

@ptrsmk
ptrsmk / dl-file.php
Last active October 24, 2018 13:52 — forked from hakre/dl-file.php
Wordpress login to download uploaded files
<?php
/* dl-file.php
* Protect uploaded files with login.
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre
* @license GPL-3.0+
* @registry SPDX
*/
require_once('wp-load.php');
function custom_sex_taxonomy()
{
$labels = array(
'name' => 'Sexes',
'singular_name' => 'Sex',
'menu_name' => 'Puppy’s Sex',
'all_items' => 'All Puppy Sexes',
'parent_item' => 'Parent Item',
'parent_item_colon' => 'Parent Item:',
'new_item_name' => 'New Puppy Sex',
foreach ( $_order->order_items as $key => $item ) {
$product_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? !empty( $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'] : $item->get_product_id();
$_product = new WC_Product( $product_id );
$needs_shipping = $_product->is_virtual();
if ( !$needs_shipping ) $needs_shipping = 0;
$downloadable = ( $_product->is_downloadable( 'yes' ) ) ? true: false;
if ( $downloadable == null ) $downloadable = 0;
@ptrsmk
ptrsmk / index.html
Last active August 29, 2015 14:18 — forked from darwin/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">