Title: ochime's Replies | WordPress.org

---

# ochime

  [  ](https://wordpress.org/support/users/ochime/)

 *   [Profile](https://wordpress.org/support/users/ochime/)
 *   [Topics Started](https://wordpress.org/support/users/ochime/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ochime/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ochime/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ochime/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ochime/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ochime/favorites/)

 Search replies:

## Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] um_after_header_meta](https://wordpress.org/support/topic/um_after_header_meta/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/um_after_header_meta/#post-18229630)
 *     ```wp-block-code
       add_action('um_after_header_meta', 'my_after_header_meta', 10, 2);function my_after_header_meta($user_id, $args) {    $user_phone  = um_user('mobile_number',$user_id);    $user_whatsapp = um_user('whatsapp',$user_id);    $truncated_phone = !empty($user_phone) ? substr($user_phone, 0, 6) . '...' : '';    $truncated_whatsapp = !empty($user_whatsapp) ? '62' . substr(ltrim($user_whatsapp, '0'), 0, 6) . '...' : '';	    if (is_user_logged_in()) {        $phone_button = '<a href="tel:' . esc_attr($user_phone) . '" class="contact-button phone-button">                                                       ' . esc_html($truncated_phone) . '                        </a>';        $wa_button = '<a href="' . esc_url('https://wa.me/' . $user_whatsapp) . '" target="_blank" class="contact-button whatsapp-button" rel="noopener">                                                        WhatsApp                        </a>';    } else {        $phone_button = '<a href="tel:' . esc_attr($truncated_phone) . '" class="contact-button phone-button login-trigger">                                                        ' . esc_html($truncated_phone) . '                        </a>';        $wa_button = '<a href="' . esc_url('https://wa.me/' . $truncated_whatsapp) . '" target="_blank" class="contact-button whatsapp-button login-trigger" rel="noopener">                                                        WhatsApp                        </a>';    }    echo '<div class="blok-a agent-block-c">' . $phone_button . $wa_button . '</div>';}
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] um_after_header_meta](https://wordpress.org/support/topic/um_after_header_meta/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/um_after_header_meta/#post-18229553)
 * <font _mstmutation=”1″></font>
 * [@andrewshu](https://wordpress.org/support/users/andrewshu/)
 * Sorry for the late reply.
 * I don’t think that’s the case -> autocomplete.
 * I’ve created a function with the same purpose on the product page (the code used
   is exactly the same).
   hook : add_action(‘woocommerce_single_product_summary’,‘
   display_agent_info_section’, 35);
 * The result was fine.
   When the user does not log in and clicks on one of the buttons,
   it will pop up the login page and no information is provided in each field.
 * Different things when I use hooks: add_action( ‘um_after_header_meta’, ‘my_after_header_meta’,
   10, 2 );
 * Can you do a test run using the function I provided and see where the error needs
   to be fixed?
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Why is the button div rendered as text?](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/#post-18195157)
 * [@missveronicatv](https://wordpress.org/support/users/missveronicatv/)
 * Because all HTML output remains rendered as plain text, even when using direct
   echo within the hook, I suspect the issue stems from the sanitization or escaping
   process applied by Ultimate Member during rendering.
 * Is there another way?
 * I tried:
 *     ```wp-block-code
       add_action('um_members_after_user_name_tmpl', function($args) {    echo '<table><tr><td>Name</td><td>HTML</td></tr></table>';}, 10);
       ```
   
 * The output is rendered as HTML.
 * Is this the correct hook?
   Thanks
    -  This reply was modified 1 year, 6 months ago by [ochime](https://wordpress.org/support/users/ochime/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Why is the button div rendered as text?](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/#post-18194937)
 * [@missveronicatv](https://wordpress.org/support/users/missveronicatv/)
 * Thank you for your response.
   I will study the link you provided.
 * I found a solution for <a> to have class=”button”.
   However, I still don’t understand
   about the tr and td tags, since the output is still rendered as text
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Why is the button div rendered as text?](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/#post-18194801)
 * [@missveronicatv](https://wordpress.org/support/users/missveronicatv/) 
   Yes, 
   I’ve applied the method and here’s my updated function
 *     ```wp-block-code
       add_action('um_members_after_user_name', 'my_members_after_user_name', 10, 2);function my_members_after_user_name($user_id, $args) {        $nickname = um_user('nickname');    $role_map = [        'subscriber'     => 'Guest',        'um_owner'       => 'Owner',        'customer'       => 'Customer',    ];    // Role function mapping    $function_map = [        'subscriber'      => 'subscriber33',        'um_owner'        => 'owner33',        'customer'        => 'customer33',    ];            $displayed_role = isset($role_map[$user_role]) ? $role_map[$user_role] : 'User';        // Default function if role not found    $content_function = isset($function_map[$user_role]) ? $function_map[$user_role] : null;            $current_user = wp_get_current_user();        ?>    <div id="wrapperModal-<?php echo esc_attr($user_id); ?>" class="wrapper-modal">        <div class="custom-member-info">            <div><?php echo esc_html($displayed_role); ?></div>            <div class="button-wrapper">                <a href="#" id="info-popup-link-<?php echo esc_attr($user_id); ?>" class="info-popup-link">More Info</a>            </div>        </div>        <!-- Modal -->        <div id="modalUserDetails-<?php echo esc_attr($user_id); ?>" class="custom-modal" style="display: none;">            <div class="modal-content">                <span id="closeModalDetails-<?php echo esc_attr($user_id); ?>" class="close-modal">&times;</span>                <h2>User Details</h2>                <?php                if ($content_function && function_exists($content_function)) {                    // Call function based on user role                    echo call_user_func($content_function, $user_id);                } else {                    echo "<p>User role not recognized.</p>";                }                ?>            </div>        </div>    </div>    <?php}function owner33($user_id) {    um_fetch_user($user_id); // Set user context based on user_id    $nickname = um_user('nickname');    $city_district = um_user('city');    $phone_number = um_user('mobile_number');        if (!$nickname) {        $nickname = "Name not available";    }    if (!$city_district) {        $city_district = "Residence not available";    }    if (!$phone_number) {        $phone_number = "Phone number not available";    }    // Create HTML with table and button    $content = "        <table class='owner-info-table'>            <tr>                <td>Name</td>                <td>$nickname</td>            </tr>            <tr>                <td>Phone Number</td>                <td>$phone_number</td>            </tr>            <tr>                <td>Residence</td>                <td>$city_district</td>            </tr>        </table>        <button class='custom-button'>Click Me</button>    ";    // Debug: log content before wp_kses_post    error_log('Content before wp_kses_post: ' . $content);        // Sanitize HTML to allow specific elements with wp_kses_post    $content = wp_kses_post($content);    // Debug: log content after wp_kses_post    error_log('Content after wp_kses_post: ' . $content);    um_reset_user(); // Reset user context    return $content; // Return sanitized content}
       ```
   
 * Even using wp_kses_post, the output is still rendered as plain text.
   Are there
   any suggestions on how to resolve this?Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Why is the button div rendered as text?](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/#post-18194750)
 * [@missveronicatv](https://wordpress.org/support/users/missveronicatv/) [@andrewshu](https://wordpress.org/support/users/andrewshu/)
 *     ```wp-block-code
       add_action("um_members_list_after_user_name_tmpl","um_122021_display_view_profile");add_action('um_members_just_after_name_tmpl','um_122021_display_view_profile',100 );function um_122021_display_view_profile( $args ){   ?>   <div class="um-members-edit-btn">		<a href="{{user.profile_url}}" >		<?php _e( 'View profile','ultimate-member' ) ?>		</a>		<button>Test</button>	</div>    <?php}
       ```
   
 * 
   Using the above hook and adding a button, the result is rendered as a button
   element
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Why is the button div rendered as text?](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/#post-18194734)
 * [@missveronicatv](https://wordpress.org/support/users/missveronicatv/) 
   <button
   class”button”>Test</button>I’ve done your suggestions, but it doesn’t solve the
   problemWhen i inspect element, output only “Test” without element <button>
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] Why is the button div rendered as text?](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/why-is-the-button-div-rendered-as-text/#post-18194243)
 * Sorry for the unclear information.
 * My idea is to display information:
    1. Nickname -> Displayed successfully
    2. Add a button; when clicked, a pop-up modal will appear -> Displayed successfully
       but cannot be clicked.
       Upon inspecting the element, the <button>Test – Click
       Here</button> element is rendered as plain text instead of a <button> element.”
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] [DOM] Found 2 elements with non-unique id #first_name-21](https://wordpress.org/support/topic/dom-found-2-elements-with-non-unique-id-first_name-21/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/dom-found-2-elements-with-non-unique-id-first_name-21/#post-18193930)
 * Ok thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin] um_after_header_meta](https://wordpress.org/support/topic/um_after_header_meta/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/um_after_header_meta/#post-18193897)
 * I am confident that I did not make a mistake in adding the phone number. Here
   is the complete function I currently have:
 *  add_action(‘um_after_header_meta’, ‘my_after_header_meta’, 10, 2);
    function
   my_after_header_meta($user_id, $args) {
 *     ```wp-block-code
       $user_phone  = um_user('mobile_number');
       $user_whatsapp = um_user('whatsapp');
       $truncated_ponsel = !empty($user_phone) ? substr($user_phone, 0, 6) . '...' : '';
       $truncated_whatsapp = !empty($user_whatsapp) ? '62' . substr(ltrim($user_whatsapp, '0'), 0, 6) . '...' : '';
   
       if (is_user_logged_in()) {
   
           // Valid buttons for logged in users
           $phone_button = '<a href="tel:' . esc_attr($user_ponsel) . '" class="contact-button phone-button">
   
                               ' . esc_html($truncated_ponsel) . '
                           </a>';
           $wa_button = '<a href="' . esc_url('https://wa.me/' . $user_whatsapp) . '" target="_blank" class="contact-button whatsapp-button" rel="noopener">
   
                               WhatsApp
                           </a>';
       } else {
   
           // Invalid buttons for logged out users
           $phone_button = '<a href="tel:' . esc_attr($truncated_ponsel) . '" class="contact-button phone-button login-trigger">
   
                               ' . esc_html($truncated_ponsel) . '
                           </a>';
           $wa_button = '<a href="' . esc_url('https://wa.me/' . $truncated_whatsapp) . '" target="_blank" class="contact-button whatsapp-button login-trigger" rel="noopener">
   
                               WhatsApp
                           </a>';
       }
   
       echo '<div class="blok-a agent-block-c">' . $phone_button . $wa_button . '</div>';
       ```
   
 *  }
 * The buttons are displayed correctly, and when the user is logged out and clicks
   one of the buttons, a modal popup opens.
 * The problem is: The fields in the form are automatically populated as I mentioned
   earlier.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Is it possible to use 2 or more attribute parameters on a shortcode?](https://wordpress.org/support/topic/is-it-possible-to-use-2-or-more-attribute-parameters-on-a-shortcode/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/is-it-possible-to-use-2-or-more-attribute-parameters-on-a-shortcode/#post-16141445)
 * Hi [@anastas10s](https://wordpress.org/support/users/anastas10s/)
 * Sorry just replied to your message.
 * I understand, and Thanks for providing a solution.
 * But given the (probably) growing number of tag usage in the future, I’m afraid
   this action will eventually require more power (CPU, RAM, etc.) So, i’m still
   looking for other ways, for example using queries anything that is lighter in
   nature.
 * Your advice will be used when I hit a dead end.
 * Once again, thanks mate!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Is it possible to use 2 or more attribute parameters on a shortcode?](https://wordpress.org/support/topic/is-it-possible-to-use-2-or-more-attribute-parameters-on-a-shortcode/)
 *  Thread Starter [ochime](https://wordpress.org/support/users/ochime/)
 * (@ochime)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/is-it-possible-to-use-2-or-more-attribute-parameters-on-a-shortcode/#post-16133868)
 * hi [@babylon1999](https://wordpress.org/support/users/babylon1999/)
    thank you
   for reply
 * I’am sorry, it seems that I am not good at explaining.
    Previously I have created
   a short code that contains 3 attributes like the following example:
 * `[products limit="12" columns="3" paginate="true" attribute="color" terms="red"
   attribute="size" terms="xl" attribute="delivery" terms="same-day" orderby="random"]`
 * See, i have a color, size, and delivery attribute in put to shortcode.
 * However the shortcode does not give the correct output. Is the method I used 
   wrong or is it true that the use of 3 attributes at once on the shortcode really
   can’t? If yes, is there another solution to display a product with 3 attributes
   in it? Hope it’s easy to understand,
    Thank you

Viewing 12 replies - 1 through 12 (of 12 total)