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 | |
class ACF_SampleOptions_Page { | |
static $slug = 'sample_options_slug'; | |
static $post_id = 'sample_options_id'; | |
public static function init() { |
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 | |
class HWID_Post_Sortable { | |
static $post_type_slug = 'post'; | |
static function init() { | |
add_action( 'manage_' . self::$post_type_slug . '_posts_custom_column', array( | |
'HWID_Post_Sortable', | |
'sort_column_display', |
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 hwid333_add_custom_attribute_columns( $fields ) { | |
$fields[] = array( | |
'slug' => 'shirt-size', | |
'name' => 'Shirt Size', // This is the name of the column in the CSV | |
); | |
$fields[] = array( |
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( 'woocommerce_shipping_package_name', 'rmg_package_names', 10, 3 ); | |
function rmg_package_names( $package_name, $i, $package ) { | |
if ( ! empty( $package['name'] ) ) { | |
$package_name = $package['name']; | |
} |
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( 'woocommerce_package_rates', 'roundup_rates', 10, 2 ); | |
function roundup_rates( $rates, $package ) { | |
foreach( $rates as $key => $rate ) { | |
$rates[$key]->cost = ceil( $rate->cost ); | |
} | |
return $rates; | |
} |
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 | |
class ACF_Product_Options { | |
static $slug = 'hwid_attributes'; | |
public static function init() { | |
// Gather the global attribute types | |
$attribute_terms = wc_get_attribute_taxonomy_names(); |
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
@media(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { | |
/* Retina-specific stuff here */ | |
} |
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
jQuery( document ).ready( function() { | |
jQuery( '#woocommerce-product-data' ).on( 'woocommerce_variations_loaded', function() { | |
var $panels = jQuery( this ).find( '.woocommerce_variation' ); | |
$panels.each( function() { | |
var sku = jQuery( this ).find( '.sku input' ).val(); | |
if ( sku ) { | |
jQuery( this ).find( 'h3 > strong' ).text( 'SKU: ' + sku ); | |
} | |
} ); |
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 | |
array ( | |
'key' => 'field_56bde9a0ea676', | |
'label' => 'Email', | |
'name' => 'email', | |
'type' => 'email', | |
'instructions' => '', | |
'required' => 0, | |
'conditional_logic' => 0, | |
'wrapper' => array ( |
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 hwid_acf_admin_footer() { | |
?> | |
<script> | |
( function( $) { | |
acf.add_filter( 'wysiwyg_tinymce_settings', function( mceInit, id ) { | |
// grab the classes defined within the field admin and put them in an array | |
var classes = $( '#' + id ).closest( '.acf-field-wysiwyg' ).attr( 'class' ); |