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
{ | |
"packages": [ | |
{ | |
"name": "ATTinyCore", | |
"maintainer": "Spence Konde", | |
"websiteURL": "https://github.com/SpenceKonde/ATTinyCore", | |
"email": "", | |
"help": { | |
"online": "" | |
}, |
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
/** | |
* Remove Wordpress Logo From Admin | |
*/ | |
add_action( 'wp_before_admin_bar_render', function(){ | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_menu( 'wp-logo' ); | |
}, 0 ); |
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
// ************* Remove default Posts type since no blog ************* | |
// Remove side menu | |
add_action( 'admin_menu', 'remove_default_post_type' ); | |
function remove_default_post_type() { | |
remove_menu_page( 'edit.php' ); | |
} | |
// Remove +New post in top Admin Menu Bar |
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 content | |
function action_woocommerce_admin_order_item_values( $product, $item, $item_id ) { | |
// WC_Order_Refund OR WC_Order_item | |
if ( $item->get_type() == 'shop_order_refund' ) { | |
$item = new WC_Order_Refund( $item_id ); | |
} else { | |
$item = new WC_Order_Item_Product( $item_id ); | |
// Only for "line_item" items type, to avoid errors | |
if ( ! $item->is_type( 'line_item' ) ) return; |
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_filter( 'woocommerce_get_order_item_totals', 'add_coupons_codes_line_to_order_totals_lines', 10, 3 ); | |
function add_coupons_codes_line_to_order_totals_lines( $total_rows, $order, $tax_display ) { | |
// Exit if there is no coupons applied | |
if( sizeof( $order->get_used_coupons() ) == 0 ) | |
return $total_rows; | |
$new_total_rows = []; // Initializing | |
foreach($total_rows as $key => $total ){ | |
$new_total_rows[$key] = $total; |
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 jobs_metaboxes( ) { | |
global $wp_meta_boxes; | |
add_meta_box('job_details', __('Job Details'), 'job_details_func', 'jobs', 'normal', 'high'); | |
} | |
add_action( 'add_meta_boxes_jobs', 'jobs_metaboxes' ); | |
function job_details_func() | |
{ | |
global $post; |
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_filter('manage_product_posts_columns' ,'custom_post_type_columns'); | |
function custom_post_type_columns($columns){ | |
// Remove Author and Comments from Columns and Add custom column 1, custom column 2 and Post Id | |
$columns['badge'] = 'Badge'; | |
return $columns; | |
} | |
add_action( 'manage_product_posts_custom_column' , 'fill_custom_post_type_columns', 10, 2 ); |
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_review_order_before_submit', 'bt_add_checkout_checkbox', 10 ); | |
/** | |
* Add WooCommerce additional Checkbox checkout field | |
*/ | |
function bt_add_checkout_checkbox() { | |
woocommerce_form_field( 'checkout_checkbox', array( // CSS ID | |
'type' => 'checkbox', | |
'class' => array('form-row mycheckbox'), // CSS Class |
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 initMap() { | |
const map = new google.maps.Map(document.getElementById("map"), { | |
zoom: 10, | |
center: { lat: 51.3055106, lng: 0.3105068 }, | |
}); | |
setMarkers(map,locations); | |
} | |
function setMarkers(map,locations){ | |
var marker, i | |
var infowindow = new google.maps.InfoWindow(); |
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
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => 12, | |
'order' => 'desc', | |
'orderby' => 'date', | |
'paged' => (get_query_var('paged') ? get_query_var('paged') : 1) | |
); | |
$post_query = new WP_Query($args); | |
if($post_query->have_posts() ) { |
NewerOlder