• Resolved jstneti

    (@jstneti)


    I like how this plugin allows me to have hidden fields and populate it with user data.
    I have a field that I populate with user Admin link like this:

    add_filter( 'caldera_forms_render_get_field_slug-svet_link', function ( $field ) {
    	$current_user = wp_get_current_user();
    	$field['config']['default'] = '<a href="/wp-admin/user-edit.php?user_id=' . $current_user->ID . '">Profil</a>';
    	return $field;
    } );

    But when I look at the entry, I want to be able to click the actual link, but instead I get text like this: Profil

    Is there a filter I can use to achieve this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Josh Pollock

    (@shelob9)

    I would not recommend using a filter for this at all, instead I would set the default value of the hidden field to /wp-admin/user-edit.php?user_id={user:ID}

    Thread Starter jstneti

    (@jstneti)

    Thanks for that info.
    I’ve put that to the field value and I get the wanted url.

    But there is still the problem that the URL in Entries is not a link, but plain text. Any idea how to make that a clickable link?

    Thread Starter jstneti

    (@jstneti)

    For some reason this was marked as resolved, even though it is not.
    I want the url to be a clickable link (a element) and not bare text. Is there any way to do that?

    Plugin Author Josh Pollock

    (@shelob9)

    @jstneti

    Correct, that is a bare link, you would need to add the HTML for a link. If you need help setting this up, please open a support request at https://calderaforms.com/support

    Thread Starter jstneti

    (@jstneti)

    Hi Josh,

    I’ve tried inputting the html, like described in the initial post, but this is how it is outputted in the Form Entry: https://imgur.com/Y13EVlM
    In the database it’s stored like this: <a href="https://localhost/testsite/wp-admin/user-edit.php?user_id=1">link</a>.

    Is there any way to achieve what I want or should I just give up?

    And btw. I can’t request support through the link provided because I don’t have an account. I am only using the free plugin.

    • This reply was modified 8 years ago by jstneti.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to get a link in the entry field?’ is closed to new replies.