SuitePlugins
Forum Replies Created
-
Ahh. I see. The button is used for submitting the form. I can come up with a way to have it removed but I have a question. How will the users be able to submit their changes after the are ready to save the changes?
- If you want the image tag, you should check if the file exist then output the img tag.
- Also, that method looks like it is missing the main UM function.
- Inside of um_user, you needed to mention ID as a string not add the dynamic ID
$Francois75 = um_get_requested_user(); um_fetch_user( $Francois75 ); $meta_value = get_user_meta( $Francois75, 'photonbre2', true ); if ( $meta_value ) { $file_path = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $meta_value; if ( file_exists( $file_path ) { echo sprintf( '<img src="%s" />', esc_url( $file_path ) ); } }Are you fetching the user data using um_fetch_user before calling the function?
Here’s what you can do
$user_id = get_current_user_id(); um_fetch_user( $user_id ); if ( UM()->user()->get_role() == 'subscriber' ) { }Thanks for reaching out. I didn’t notice any downtime but if the site was down for you then I will do some investigations. If you ever notice the site is down or have an inquiry about the site, services or any of your plugins, you can send an email and we’d be happy to answer or investigate.
Forum: Plugins
In reply to: [User List for Ultimate Member] Non-logged usersCurrently the plugin only shows for logged-in users since that is the only way to know if a user is connected with the viewer in any way. What I can do is make a random list widget that can be shown to everyone.
Forum: Plugins
In reply to: [Login Widget for Ultimate Member] Error in redirect after login.Hey @calle81,
Do you have a screenshot of this happening? I have never heard of this bug before.
@dydybetty11 It seem as though you used code from the outdated section. You can undo this and use just the filter.
function custom_um_profile_query_make_posts( $args = array() ) { // Change the post type to our liking. $args['post_type'] = 'page'; return $args; } add_filter( 'um_profile_query_make_posts', 'custom_um_profile_query_make_posts', 12, 1 );@nikolas27 I will add an installable zip file but the best way to add the code is through a child-theme or a custom plugin.
Are you saying you want to hide certain fields based on what course a student has chosen?
What plugin are using for the courses? Do you already have a way to know what course ID each student has?
Did you modify the default WordPress roles?
Are you using a multi-site or single site?function custom_get_um_user_data( $meta_key = '', $user_id = 0 ) { if ( ! $meta_key ) { return; } if ( ! $user_id ) { $user_id = um_get_requested_user(); } $return_value = ''; um_fetch_user( $user_id ); $meta_value = um_user( $meta_key ); // If the value is an array and it isn't empty. if ( ! empty( $meta_value ) && is_array( $meta_value ) ) { $return_value = implode( ', ', $meta_value ); } elseif ( ! empty( $meta_value ) ) { $return_value = $meta_value; } um_reset_user(); return $return_value; }There was a typo in it.
This one below is a way to debug things though
function custom_get_um_user_data( $meta_key = '', $user_id = 0 ) { if ( ! $meta_key ) { return; } if ( ! $user_id ) { $user_id = um_get_requested_user(); } echo ' User ID is '. $meta_value; $return_value = ''; um_fetch_user( $user_id ); $meta_value = um_user( $meta_key ); // If the value is an array and it isn't empty. if ( ! empty( $meta_value ) && is_array( $meta_value ) ) { $return_value = implode( ', ', $meta_value ); } elseif ( ! empty( $meta_value ) ) { $return_value = $meta_value; } echo ' Return Value is '. $meta_value; um_reset_user(); return $return_value; }- This reply was modified 7 years, 1 month ago by SuitePlugins.
Hey @aj-carter-1,
This sound really interesting. To get this done, I assume you would need to do the following
- Hook into um_after_user_updated to send data after profile is updated
- Use wp_remote_post to send info
- On the receiving side set up a listener or REST API functionality to receive the data and use it how it is needed.
Hi @throm17
Try using this custom function
function custom_get_um_user_data( $meta_key = '', $user_id = 0 ) { if ( ! $meta_key ) { return; } if ( ! $user_id ) { $user_id = um_get_requested_user(); } $return_value = ''; um_fetch_user( $user_id ); $meta_value = um_user( $meta_key ); // If the value is an array and it isn't empty. if ( ! empty( $meta_value ) && is_array( $meta_value ) ) { $return_value = implode( ', ', $meta_value ); } elseif ( ! emtpy( $meta_value ) ) { $return_value = $meta_value; } um_reset_user(); return $return_value; }You can use the function like this
echo custom_get_um_user_data('percing_body')Forum: Plugins
In reply to: [User List for Ultimate Member] list of suggestions in random orderSure, that would be no problem.
I will include it in the next update.
That script seems to be for Ultimate Member versions prior to 2.0
Use this instead
UM()->user()->user_exists_by_id( $user_id );Hey @jmayorga9112
You want to check if the file exists.
add_action( ‘um_user_login’, ‘my_user_login’, 10, 1 ); function my_user_login( $args ) { $user_id = get_current_user_id(); $file_name = 'ENTER NAME OF FILE YOU ARE LOOKING FOR HERE'; $file = UM()->uploader()->get_upload_base_url() . $user_id . "/" . $file_name; if ( ! file_exists( $file ) ) { echo “no file was uploaded”; } }Just enter the file name and this should give you the results you are looking for.