Skip to content

Instantly share code, notes, and snippets.

dvrcthewrld

Block or report user

Report or block dvrcthewrld

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dvrcthewrld
dvrcthewrld / dl-file.php
Last active Oct 24, 2018 — forked from hakre/dl-file.php
Wordpress login to download uploaded files
View dl-file.php
<?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');
View functions-custom-taxonomy.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',
View modification-for-pro-export-helper.php
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;
View 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)">
You can’t perform that action at this time.