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
add_action( 'um_before_new_user_register', 'require_whitelisted_email_for_signup' ); | |
function require_whitelisted_email_for_signup( $args ) { | |
$user_email = $args['user_email']; | |
$approved_domains = array( 'yahoo.com', 'gmail.com', 'hotmail.com' ); | |
$email_approved = false; | |
foreach ( $approved_domains as $domain ) { | |
$prefixed_domain = '@' . $domain; | |
if ( str_ends_with( $user_email, $prefixed_domain ) ) { | |
$email_approved = true; |
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 | |
/** | |
* Display Simple Product SKU, in WooCommerce loop pages, before item name | |
* | |
* @return void | |
*/ | |
function simple_product_sku_before_loop_item_title(){ | |
global $product; | |
$type = $product->product_type; |
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 | |
/** | |
* Custom sanitization of fields | |
*/ | |
add_filter('um_profile_field_filter_hook__','my_custom_sanitize_fields', 99, 2 ); | |
function my_custom_sanitize_fields( $value, $data ){ | |
// Add tags to mail value | |
if ( !is_array( $value ) ) { |
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 Date format in front-end | |
*/ | |
add_filter('um_profile_field_filter_hook__date','my_custom_sanitize_fields', 9999, 2 ); | |
function my_custom_sanitize_fields( $value, $data ){ | |
global $ultimatemember; | |
if( $data['metakey'] == 'date-pickah' ){ | |
$value = $ultimatemember->datetime->format( $value, "d M Y"); |
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 /* Don't include this line if your child theme functions.php already includes it */ | |
function my_et_divi_output_content_wrapper_end() { | |
echo '</div> <!-- #left-area -->'; | |
if ( | |
( is_product() && 'et_full_width_page' !== get_post_meta( get_the_ID(), '_et_pb_page_layout', true ) ) | |
|| | |
( ( is_shop() || is_product_category() || is_product_tag() ) && 'et_full_width_page' !== et_get_option( 'divi_shop_page_sidebar', 'et_right_sidebar' ) ) | |
) { | |
dynamic_sidebar( 'eCommerce Sidebar' ); |
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
add_filter('um_admin_custom_search_filters','add_my_custom_search_fields', 10, 1); | |
function add_my_custom_search_fields($fields) { | |
$fields['field_meta_key'] = array('title' => 'Enter field title'); // replace 'field_meta_key' with your field meta key | |
return $fields; | |
} |
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
#Insall Ajenti | |
apt-get update | |
wget http://repo.ajenti.org/debian/key -O- | apt-key add - | |
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list | |
apt-get update | |
apt-get install ajenti | |
service ajenti restart | |
# Uninstall Apache2 |
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
/** | |
* Returns a user meta value | |
* Usage [um_user user_id="" meta_key="" ] // leave user_id empty if you want to retrive the current user's meta value. | |
* meta_key is the field name that you've set in the UM form builder | |
* You can modify the return meta_value with filter hook 'um_user_shortcode_filter__{$meta_key}' | |
*/ | |
function um_user_shortcode( $atts ) { | |
$atts = extract( shortcode_atts( array( | |
'user_id' => get_current_user_id(), | |
'meta_key' => '', |
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 | |
/** | |
* Show users with a Job Title "'WP Plugin developer " only | |
**/ | |
add_filter('um_prepare_user_query_args', 'um_my_custom_query_args', 99, 2); | |
function um_my_custom_query_args( $query_args, $args ) { | |
if( $args["form_id"] == "1" ) { // you can validate the current member directory form ID | |
$query_args['meta_query'][] = array( |