This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WPD - Display categories in the Data Details table | |
*/ | |
add_action( 'wpd_dataoutput_bottom', 'add_wpd_categories' ); | |
function add_wpd_categories() { ?> | |
<?php if ( in_array( get_post_type(), array( 'flowers' ) ) ) { ?> | |
<tr><td><span>Categories:</span></td><td><?php echo get_the_term_list( $post->ID, 'flowers_category', '', ', ' ); ?></td></tr> | |
<?php } ?> | |
<?php if ( in_array( get_post_type(), array( 'concentrates' ) ) ) { ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Removes the Inventory Management add-on's front end display of available inventory */ | |
add_action( 'wpd_dataoutput_bottom', 'remove_wpd_inventory_data', 1 ); | |
function remove_wpd_inventory_data() { | |
remove_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data_flowers' ); | |
remove_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data_concentrates' ); | |
remove_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data_edibles' ); | |
remove_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data_prerolls' ); | |
remove_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data_topicals' ); | |
remove_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data_growers' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Adds a new version of the In Stock message for each menu type */ | |
add_action( 'wpd_dataoutput_bottom', 'add_wpd_inventory_data', 10 ); | |
function add_wpd_inventory_data() { ?> | |
<?php if ( ! get_post_meta( get_the_ID(), '_inventory_flowers', true ) ) { } else { ?> | |
<tr><td><span>In stock:</span></td><td>YES</td></tr> | |
<?php } ?> | |
<?php if ( ! get_post_meta( get_the_ID(), '_inventory_concentrates', true ) ) { } else { ?> | |
<tr><td><span>In stock:</span></td><td>YES</td></tr> | |
<?php } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display your selected location(s) within the WP Dispensary shortcodes | |
* Requires the "Dispensary Locations" add-on from WP Dispensary | |
* | |
* @link https://www.wpdispensary.com/downloads/dispensary-locations | |
*/ | |
add_action( 'wpd_shortcode_inside_top', 'acme_mylocation' ); | |
function acme_mylocation() { | |
global $post; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
span.mylocation { | |
background: #FFF; | |
font-size: 13px; | |
padding: 10px; | |
position: absolute; | |
top: 5px; | |
right: 5px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_excerpt_embed', 'get_excerpt_embed' ); | |
function get_excerpt_embed( $output ) { | |
return the_content(); | |
return $output; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function activate_acme_cpt() { | |
cpt_function(); | |
/** CPT taxonomy functions can be added too */ | |
cpt_tax_function(); | |
global $wp_rewrite; | |
$wp_rewrite->init(); | |
$wp_rewrite->flush_rules(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display featured image wrapped in a link to the post | |
*/ | |
echo "<a href='" . get_permalink( $post->ID ) ."'>"; | |
the_post_thumbnail( 'thumbnail' ); | |
echo "</a>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes Storefront's Welcome page | |
*/ | |
if ( ! class_exists( 'Storefront_Admin' ) ) : | |
class Storefront_Admin { | |
public function __construct() { | |
remove_action( 'admin_menu', 'welcome_register_menu', 1 ); | |
} | |
} |