This file contains 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 | |
/** | |
* All custom functions should be defined in this class | |
* and tied to WP hooks/filters w/in the constructor method | |
*/ | |
class Custom_Functions { | |
// Custom metaboxes and fields configuration |
This file contains 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
node_modules | |
*.idea |
This file contains 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
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#e5303, 6.5%)", | |
"@brand-success": "#32db64", |
This file contains 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
/* | |
This file is a brief example of how to use angularfire to authenticate a user, save that user's public profile to firebase, then | |
ensure that both the authenticated and public user are available in your controllers. | |
The route configuration uses angular-ui-router: https://github.com/angular-ui/ui-router | |
*/ | |
This file contains 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
/* ============================================ | |
* bootstrap-infiniteScroll.js | |
* ============================================ */ | |
!function ($) { | |
'use strict'; | |
var InfiniteScroll = function (el, options) { | |
this.$element = $(el); | |
this.$data = $(el).data(); | |
this.$options = options; |
This file contains 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
//Partial File find and replace in the actual file | |
/** | |
* load the user contacts | |
*/ | |
function getUserContacts() | |
{ | |
try{ | |
$response = $this->api->api('/me/friends?fields=id,name,email,birthday,gender'); | |
} | |
catch( FacebookApiException $e ){ |
This file contains 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
// Custom field Type | |
?> | |
<p class="form-field custom_field_type"> | |
<label for="custom_field_type"><?php echo __( 'Custom Field Type', 'woocommerce' ); ?></label> | |
<span class="wrap"> | |
<?php $custom_field_type = get_post_meta( $post->ID, '_custom_field_type', true ); ?> | |
<input placeholder="<?php _e( 'Field One', 'woocommerce' ); ?>" class="" type="number" name="_field_one" value="<?php echo $custom_field_type[0]; ?>" step="any" min="0" style="width: 80px;" /> | |
<input placeholder="<?php _e( 'Field Two', 'woocommerce' ); ?>" type="number" name="_field_two" value="<?php echo $custom_field_type[1]; ?>" step="any" min="0" style="width: 80px;" /> | |
</span> | |
<span class="description"><?php _e( 'Place your own description here!', 'woocommerce' ); ?></span> |
This file contains 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
function woo_add_custom_general_fields_save( $post_id ){ | |
// Text Field | |
$woocommerce_text_field = $_POST['_text_field']; | |
if( !empty( $woocommerce_text_field ) ) | |
update_post_meta( $post_id, '_text_field', esc_attr( $woocommerce_text_field ) ); | |
// Number Field | |
$woocommerce_number_field = $_POST['_number_field']; | |
if( !empty( $woocommerce_number_field ) ) |
This file contains 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 Custom Field Value | |
echo get_post_meta( $post->ID, 'my-field-slug', true ); | |
// You can also use | |
echo get_post_meta( get_the_ID(), 'my-field-slug', true ); | |
?> |
This file contains 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
add_action( 'woocommerce_product_write_panel_tabs', 'woo_add_custom_admin_product_tab' ); | |
function woo_add_custom_admin_product_tab() { | |
?> | |
<li class="custom_tab"><a href="#custom_tab_data"><?php _e('My Custom Tab', 'woocommerce'); ?></a></li> | |
<?php | |
} |
NewerOlder