Snake93
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Child Theme No Longer Overriding Woocommerce TemplatesI opened a support request on the astra support forum: https://www.ads-software.com/support/topic/child-theme-no-longer-overriding-woocommerce-templates-2/
I have located the file that is causing the problem and it appears to be: astra/inc/ compatibility/woocommerce/class-astra-woocommerce.php
I hope they solve it quickly, in the meantime I go back to version 3.8.5 and disable the updates.
Forum: Plugins
In reply to: [WooCommerce] Child Theme No Longer Overriding Woocommerce TemplatesI have the same problem here. All my custom templates are no longer overwritten and everything worked fine until a few days ago. I searched for the problem and realized it was the fault of the astra update (ver 3.9.0). Going back to version 3.8.5 the problem disappears and everything goes back to working as before. I checked astra’s functions.php and style.css files of both version, there is nothing different but the version itself. So you need to understand which file the problem arises from.
I am posting the first response again as it was held for moderation. Sorry…
Hi Daniel. Thanks for the reply. When I published the question I had already checked the setting you suggested.
However, the problem only concerns the [avatar] shortcode. While in [avatar_upload] the original image and thumbnail are instantly updated as soon as the page has been reloaded.
I tried to replicate the [avatar_upload] shortcode for some needs. I understand that images are updated immediately only if
do_action( 'wpua_update', $valid_user->ID );
is present, when this is not there, the image does not update instantly and you have to reload the page several times.Shortcode 1
The first shortcode shows the select file field with the upload button.//SHORTCODE UPLOAD BUTTON ONE-USER-AVATAR function avatar_upload($user) { //Global global $wpua_force_file_uploader, $show_avatars, $wpua_shortcode, $wp_user_avatar, $all_sizes, $blog_id, $post, $wpdb, $current_user, $wp_user_avatar, $wpua_allow_upload, $wpua_edit_avatar, $wpua_functions; // Default user is current user $valid_user = $current_user; //Function do_action( 'wpua_update', $valid_user->ID ); ob_start(); ?> <form id="wpua-edit-<?php echo esc_attr( $user->ID ); ?>" class="wpua-edit" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="wp-user-avatar" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wp-user-avatar' : 'wp-user-avatar-existing' ) ?>" value="<?php echo esc_attr( $wpua ); ?>" /> <div class="upload-avatar" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-upload-button' : 'wpua-upload-button-existing' ); ?>"> <input name="wpua-file" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-file' : 'wpua-file-existing' ); ?>" type="file" class="wp-input-file"/> <button type="submit" class="button" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-upload' : 'wpua-upload-existing' ); ?>" name="submit" value="<?php esc_html_e( 'Aggiorna', 'one-user-avatar' ); ?>"> <?php esc_html_e( 'Upload', 'one-user-avatar' ); ?> </button> </div> <div id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-images' : 'wpua-images-existing' ); ?>" class="<?php echo esc_attr( $hide_images ); ?>"> <p id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-remove-button' : 'wpua-remove-button-existing' ); ?>" class="<?php echo esc_attr( $hide_remove ); ?>"> <button type="button" class="button" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-remove' : 'wpua-remove-existing' ); ?>" name="wpua-remove"><?php esc_html_e( 'Remove Image', 'one-user-avatar' ); ?></button> </p> </div> <input type="hidden" name="wpua_action" value="update" /> <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( $user->ID ); ?>" /> <?php wp_nonce_field( 'update-user_' . $user->ID ); ?> <?php submit_button( __( 'Update Profile', 'one-user-avatar' ) ); ?> </form> <?php return ob_get_clean(); } add_shortcode('mts_avatar_upload', 'avatar_upload');
Shortcode 2
The second shortcode has the task of showing only the avatar, just like it happens for [avatar] shortcode.//SHORTCODE SHOW AVATAR ONE-USER-AVATAR function avatar_show($user) { //Global global $wpua_force_file_uploader, $show_avatars, $wpua_shortcode, $wp_user_avatar, $blog_id, $post, $wpdb, $current_user, $wp_user_avatar, $wpua_allow_upload, $wpua_edit_avatar, $wpua_functions, $wpua_is_profile; // Default user is current user $valid_user = $current_user; // If I insert do_action( 'wpua_update', $valid_user->ID ); here then the image is updated instantly after the page refresh. However, if the code string is entered here, that breaks the functioning of the first shortcode. // Call one of the plugin's functions $has_wp_user_avatar = has_wp_user_avatar(@$valid_user->ID); $avatar_thumbnail = $has_wp_user_avatar ? get_wp_user_avatar_src($valid_user->ID, 96) : $avatar_medium_src; // If avatars are enabled, get original avatar image or show blank $avatar_medium_src = 1 == (bool) $show_avatars ? $wpua_functions->wpua_get_avatar_original( @$valid_user->user_email, 'medium' ) : includes_url() . 'images/blank.gif'; // Check if user has wp_user_avatar, if not show image from above $avatar_medium = $has_wp_user_avatar ? get_wp_user_avatar_src( $valid_user->ID, 'medium' ) : $avatar_medium_src; // Check if user has wp_user_avatar, if not show image from above $avatar_thumbnail = $has_wp_user_avatar ? get_wp_user_avatar_src( $valid_user->ID, 96 ) : $avatar_medium_src; $edit_attachment_link = esc_url( add_query_arg( array( 'post' => $wpua, 'action' => 'edit', ), admin_url( 'post.php' ) ) ); ob_start(); ?> <form id="wpua-edit-<?php echo esc_attr( $user->ID ); ?>" class="wpua-edit" action="" method="post" enctype="multipart/form-data"> <p id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-thumbnail' : 'wpua-thumbnail-existing' ); ?>"><img src="<?php echo esc_url( $avatar_thumbnail ); ?>" alt="<?php echo esc_attr( __( 'Thumbnail', 'one-user-avatar' ) ); ?>"/></p> </form> <?php return ob_get_clean(); } add_shortcode('mts_avatar_show', 'avatar_show');
It is not possible to keep the
do_action('wpua_update', $ valid_user-> ID);
without breaking the first shortcode? Or connect the second shortcode to the first in some way so that you can make it work.It seems to me that if you separate the avatar display from
do_action('wpua_update', $ valid_user-> ID);
then the avatar does not update immediately.Do you have any suggestions? Thanks again.
- This reply was modified 3 years ago by Snake93.
Thanks for the tip. In the end I structured it like this and it worked.
//SHORTCODE UPLOAD BUTTON ONE-USER-AVATAR function avatar_upload($user) { //Global global $wpua_force_file_uploader, $show_avatars, $wpua_shortcode, $wp_user_avatar, $all_sizes, $blog_id, $post, $wpdb, $current_user, $wp_user_avatar, $wpua_allow_upload, $wpua_edit_avatar, $wpua_functions, $errors, $wpua_is_profile, $wpua_upload_size_limit, $wpua_upload_size_limit_with_units; // Default user is current user $valid_user = $current_user; //Function do_action( 'wpua_update', $valid_user->ID ); ob_start(); ?> <form id="wpua-edit-<?php echo esc_attr( $user->ID ); ?>" class="wpua-edit" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="wp-user-avatar" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wp-user-avatar' : 'wp-user-avatar-existing' ) ?>" value="<?php echo esc_attr( $wpua ); ?>" /> <div class="upload-avatar" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-upload-button' : 'wpua-upload-button-existing' ); ?>"> <input name="wpua-file" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-file' : 'wpua-file-existing' ); ?>" type="file" class="wp-input-file"/> <button type="submit" class="button" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-upload' : 'wpua-upload-existing' ); ?>" name="submit" value="<?php esc_html_e( 'Aggiorna', 'one-user-avatar' ); ?>"> <?php esc_html_e( 'Upload', 'one-user-avatar' ); ?> </button> </div> <div id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-images' : 'wpua-images-existing' ); ?>" class="<?php echo esc_attr( $hide_images ); ?>"> <p id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-remove-button' : 'wpua-remove-button-existing' ); ?>" class="<?php echo esc_attr( $hide_remove ); ?>"> <button type="button" class="button" id="<?php echo esc_attr( ( 'add-new-user' == $user ) ? 'wpua-remove' : 'wpua-remove-existing' ); ?>" name="wpua-remove"><?php esc_html_e( 'Remove Image', 'one-user-avatar' ); ?></button> </p> </div> <input type="hidden" name="wpua_action" value="update" /> <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( $user->ID ); ?>" /> <?php wp_nonce_field( 'update-user_' . $user->ID ); ?> <?php submit_button( __( 'Update Profile', 'one-user-avatar' ) ); ?> </form> <?php return ob_get_clean(); } add_shortcode('mts_avatar_upload', 'avatar_upload');
- This reply was modified 3 years ago by Snake93.
Hi Daniel. Thanks for the reply. When I published the question I had already checked the setting you suggested.
However, the problem only concerns the [avatar] shortcode. While in [avatar_upload] the original image and thumbnail are instantly updated as soon as the page has been reloaded.
Forum: Plugins
In reply to: [One User Avatar | User Profile Picture] Can it be used with ACF Pro ?Hello. Thanks for the reply. Everything is displayed correctly, now the One User Avatar uploader looks like an ACF built-in field, it also works on Profile Builder.
However, there is a problem: The Update Button from ACF and Profile builder don’t work (they are not clickable). Only the One User Avatar update button works and when you click on it to update the profile picture the uploader disappears displaying only the shortcode (as if it were not read). In this way the data is not updated. All this happens on the Frontend, while from the backend the shortcode is not displayed at all.
Is there a solution to this problem?
Also I wanted to ask other questions:
1) Is it possible in some way to integrate only the image upload field with the select file and upload button?
2) Or, is it possible to use Meta fields to work with ACF or any other profile builder? For example, if I enter wp_user_avatar as an ACF meta field it doesn’t work?
3) Furthermore, is it possible in some way to change the layout of the layout? I intend to change the position of the Update, Load, Remove buttons, as well as the thumbnails. Maybe have more control over the layout in general.
The plugin is great. The part that I find interesting is the one where the image is also deleted from the media library when the user decides to change or delete the avatar. In this way the media hybrid is always clean and space is not unnecessarily occupied.
Finally: will a pro version be possible in the future? Maybe offering more options and possibilities for users to modify various aspects such as graphics to their liking and make it compatible with elementor maybe.
Thanks for everything, I’m waiting for your reply.
Greetings.- This reply was modified 3 years, 3 months ago by Snake93.
Forum: Plugins
In reply to: [Simple Local Avatars] Uploading on the Front EndWhere does this code go? In functions.php?
Can it work with ACF?- This reply was modified 3 years, 3 months ago by Snake93.
I have same problem, elementor not loading or displaying blank panel widget when editing