Skip to content

Instantly share code, notes, and snippets.

View Pamps's full-sized avatar

Darren Lambert Pamps

View GitHub Profile
<?php
// Change the image size used for the WooCommerce product gallery image zoom
// 'medium' or 'large' are normally the best options
add_filter( 'woocommerce_gallery_full_size', function( $size ) {
return 'medium';
} );
?>
@Pamps
Pamps / country_is_in_europe.php
Created July 10, 2018 16:58
Returns if a country is in Europe, in PHP
<?php
// Returns if a country is in Europe
// Pass in country name or code e.g. 'Spain' or 'ES'.
function country_is_in_europe( $country ) {
// Our list of countries
$countries = array(
'AT' => 'Austria',
'BE' => 'Belgium',
@Pamps
Pamps / wordpress-set-new-post-title-placeholder.php
Last active November 1, 2019 08:23
Change the WordPress New Post title placeholder
<?php
// Add this to your theme functions.php file, or in a plugin file
// This example shows how to change the title field placeholder
// Post types titles
function cpm_change_default_title( $title ) {
$screen = get_current_screen();
if ( 'product' == $screen->post_type ) { // Change product for your post_type (.e.g post, page, etc)