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 admin user | |
add_action( 'init', function () { | |
$username = 'admin'; | |
$password = 'password'; | |
$email_address = '[email protected]'; | |
if ( ! username_exists( $username ) ) { | |
$user_id = wp_create_user( $username, $password, $email_address ); |
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 | |
// 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'; | |
} ); | |
?> |
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 | |
// 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', |
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 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) |
NewerOlder