Viewing 4 reply threads
  • Author
    Posts
    • #3208
      hipsterbrown
      Member

      I had a working widget on one WP install, in which I was building Piklist plugin containing that widget code. On other installs of the plugin, I keep getting this error while displaying the widget on the front-end:

      
      Notice: Undefined index: widget in /home/vagrant/public/wp-content/plugins/piklist/includes/class-piklist-universal-widget.php on line 157
      

      Any ideas what may be causing this issue?

    • #3210
      Steve
      Keymaster

      @hipsterbrown– Can you post the widget code here, or email to [email protected] ?

    • #3211
      hipsterbrown
      Member

      Form Code

      
      <?php
      
      function check_key() {
        $winnower_settings = get_option('winnower_theme_settings');
        $api_key_confirmation = $winnower_settings['api_key_confirmation'];
      
        if($api_key_confirmation == 'true') {
          return '<p>Your API Key is approved so the widget will show up.</p>';
        } else {
          return '<p>Please enter an approved API Key.</p>';
        }
      }
      
      piklist('field', array(
        'type' => 'html',
        'field' => 'widget_help',
        'value' => check_key()
      ));
      

      Front-End Code

      
      <?php
      
      /***
      Title: Winnower Badge
      Description: Shows on pages with posts that you have published on The Winnower.
      ***/
      
      global $post;
      $winnower_settings = get_option('winnower_theme_settings');
      $api_key_confirmation = $winnower_settings['api_key_confirmation'];
      $ID = $post->ID;
      $pub_status = get_post_meta($ID, 'win_toggle', true);
      
      if($api_key_confirmation == 'true' && $pub_status == 'true' && !is_home()):
        $iframe_src = "https://staging.thewinnower.com/api/blog_badge?";
        $blog_id = $winnower_settings['user_blog_id'];
      
      echo $before_widget;
      ?>
      
      <iframe src="<?= $iframe_src.'blog_id='.$blog_id.'&blog_post_id='.$ID; ?>" width="1000" height="440"></iframe>
      
      <?php
      echo $after_widget;
      endif;
      

      Thanks for your help.

    • #3212
      Steve
      Keymaster

      @hipsterbrown– It looks like Piklist doesn’t like widgets that have no settings. We’ll look into this.

    • #3214
      Steve
      Keymaster

      We will have this fixed in our beta version this week. Will email to you when it’s ready.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.