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 this to a code snippet via the Code Snippets plugin (modified from (from https://alfatahnesab.com/how-to-create-elementor-user-registration-form/) | |
// This is the hooks of elementor form after form submit (from https://alfatahnesab.com/how-to-create-elementor-user-registration-form/) | |
add_action( 'elementor_pro/forms/new_record', 'alfa_elementor_form_create_new_user' , 10, 2 ); | |
function alfa_elementor_form_create_new_user($record,$ajax_handler) // creating function | |
{ | |
$form_name = $record->get_form_settings('form_name'); | |
//Check that the form is the "Create New Subscriber" or "Create New Editor" (or whichever form names you want) if not - stop and 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
// Validate confirmation email ref (https://github.com/elementor/elementor/issues/8684) | |
add_action( 'elementor_pro/forms/validation', function ( $record, $ajax_handler ) { | |
// Create variables representing the field ids of the fields | |
$first_email_field = $record->get_field( ['id' => 'email'] ); // Field ID (Advanced tab) is "email" | |
$second_email_field = $record->get_field( ['id' => 'email_confirm'] ); // Field ID (Advanced tab) is "email_confirm" | |
if ( property_exists( $second_email_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 | |
// Refer: https://wordpress.stackexchange.com/questions/49686/how-do-i-display-logged-in-username-if-logged-in | |
// Recommend adding as a code snippet using the code snippets plugin. Can also add to functions.php but will need to remember to transfer if change theme | |
function mysite_custom_shortcode_makers() { | |
if( is_user_logged_in() ) { | |
$user = wp_get_current_user(); | |
return '<h2>Hello ' . $user->first_name . ', welcome to your shop dashboard!</h2>'; | |
} |
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 | |
// Add this to the functions.php file on your child theme | |
/** Limit download purchases to one per account | |
* HT to Scott Deluzio for original code this is modified from https://scottdeluzio.com/easy-digital-downloads-limit-one-per-customer/ | |
// Give nag message if customer has bought download previously | |
add_filter( 'edd_can_checkout', 'sd_set_purchase_limit' ); | |
function sd_set_purchase_limit(){ |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php of your child theme. | |
//* This code courtesy of Jetpack | |
function jetpackme_filter_exclude_category( $filters ) { | |
$filters[] = array( 'not' => | |
array( 'term' => array( 'category.slug' => 'category' ) ) | |
); // Replace 'category' with the slug of the category to exclude | |
return $filters; | |
} |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add new custom image sizes | |
add_image_size( 'image-name', 150, 100, TRUE ); | |
/* DO NOT include the following it is for instructional purpose only | |
* | |
* Replace 'image-name' with the descriptive name you want to identify the new image size with. | |
* DO NOT use thumb, thumbnail, medium, large, or post-thumbnail |
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 this CSS to your store Styles section under CSS mode */ | |
/* http://www.storenvy.com/ */ | |
/* Photo Slider */ | |
.product_photo_slider { | |
background: #fff; /*: Product Slider Background :*/ | |
border: 5px solid #eaeaea; /*: Product Slider Border :*/ | |
color: #555; /*: Product Slider Product Description :*/ | |
display: block; | |
margin-left:8px; |