Viewing 5 reply threads
  • Author
    Posts
    • #2431

      Hey,

      I’m trying to get the value of an option and set that value as the content of an editor field, but it is not working. It just appears empty. I’ve confirmed that the option is set correctly. Any ideas?

      Code is as follows:

      $wpk_solquote_settings = get_option('wpk_solquote_settings');
      
      piklist('field', array(
          'type' => 'editor'
      ,'field' => 'post_content'
      ,'scope' => 'post'
      ,'label' => __('Innehåll','wpk-solquote')
      ,'value' => $wpk_solquote_settings['pdf_quote_template']
      ,'attributes' => array(
              'class' => 'text'
          )
      ));
      ));
    • #2432
      Steve
      Keymaster

      @wpkonsulterna– It looks like you are trying to replace the default editor with a Piklist editor, correct?

      Either way this is a bug. When setting the scope => post, the value parameter doesn’t work correctly.

    • #2434

      Basically, yes. This is designed to load a page template from the settings, then output it to a custom metabox connected to page content so that the user can override it on a post-by-post basis if desired. Do you know any workarounds for this bug?

    • #2449
      Steve
      Keymaster

      @wpkonsulterna–- This fix will be in the next version of Piklist, but you can fix it now.

      Open includes/class-piklist-form.php, and replace line 652:

      if (!is_wp_error($object))
      

      with this:

      if (!is_wp_error($object) && $object->post_status != 'auto-draft')
      
    • #2451

      Are you sure that’s the right file? Line 652 of class-piklist-form.php is:
      $wrapper = 'widget';

      I searched for
      if (!is_wp_error($object)) but could not find it in that file.

    • #2453
      Steve
      Keymaster

      @wpkonsulterna–- I’m running a development version sorry. Email me at [email protected], and we’ll help you out.

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