Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #7145
      kutyadog
      Participant

      Hello,
      New to piklist.
      I am building a simple shortcode form that allows the user to paste a URL into a textfield. Once this field has a value, I want to show the image below it.

      /*
      Name: Photo
      Description: Embed a photo into the content.
      Shortcode: photo
      Icon: dashicons-format-image
      Preview: true
      */
      
      piklist('field', array(
          'type' => 'text'
          ,'field' => 'src'
          ,'label' => __('Photo URL')
          ,'attributes' => array(
            'class' => 'large-text'
          )
        ));
      
      echo '<img src="'. get_the_url_for_the_field_above() .'" alt="How to get that value?" height="42" width="42">'
      
      
    • #7148
      Steve
      Keymaster

      @kutyadog– Welcome to the Piklist community!

      Piklist doesn’t have any functions for that. You will probably have to use javascript or ajax to do this.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.