- This topic has 5 replies, 2 voices, and was last updated 7 years, 4 months ago by
Steve.
-
AuthorPosts
-
-
September 12, 2014 at 8:28 am #2431
wpkonsulternaMemberHey,
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' ) )); )); -
September 12, 2014 at 10:44 am #2432
SteveKeymaster@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, thevalueparameter doesn’t work correctly. -
September 15, 2014 at 3:05 am #2434
wpkonsulternaMemberBasically, 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?
-
September 17, 2014 at 11:53 am #2449
SteveKeymaster@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')
-
September 18, 2014 at 9:06 am #2451
wpkonsulternaMemberAre 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. -
September 18, 2014 at 9:29 am #2453
SteveKeymaster@wpkonsulterna–- I’m running a development version sorry. Email me at [email protected], and we’ll help you out.
-
-
AuthorPosts
- You must be logged in to reply to this topic.