• Hi,

    I added a url field for link with condition like this

    <?php if ($attributes['uni-profile-link']){ ?>
    <a href="<?php echo esc_url($attributes['uni-profile-link']); ?>" <?php if ($attributes['uni-profile-link-target']) { echo 'target="_blank"'; } ?>><?php } ?>
    <?php echo $attributes['uni-profile-name']; ?>
    <?php if ($attributes['uni-profile-link']){ ?></a><?php } ?>

    The target toogle field work and when I disable target toogle the target attribute remove from the frontend. But once I add a url and then later remove that url from the url field, the anchor tag with old link not get removed in frontend, it remains there, when url is blank the if condition
    <?php if ($attributes['uni-profile-link']){ ?>
    Should work , but its not work, its works only if initially I have kept it blank, once I add a url, it always remain even if I remove and make it blank later.

    • This topic was modified 4 years, 4 months ago by hozefasmile.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter hozefasmile

    (@hozefasmile)

    I even tried
    <?php if (! empty($attributes['uni-profile-link'])){ ?>

    But still not work

    Thread Starter hozefasmile

    (@hozefasmile)

    Hi @nk

    Any update on this issue ? for temporary solution I am trying this, providing the “##” value as URL field value and then put this condition in block output

    <?php if ($attributes['uni-profile-link'] != '##'){ ?>
    <a href="<?php echo esc_url($attributes['uni-profile-link']); ?>">
    <?php } ?>

    But obviously its not a natural solution.

    Thanks
    Hozefa

    Plugin Author nK

    (@nko)

    Hi Hozefa.

    In the next update will be added Reset button for URL control.

    Regards, nK.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘conditions not work after removing url’ is closed to new replies.