Viewing 4 reply threads
  • Author
    Posts
    • #6944
      upside
      Member

      Hey Guys,

      Huge fan of Piklist and really excited about all of the recent improvements, especially add-more related. I’m trying to add an editor field to a page template and want to be able to use shortcodes in the editor field. I currently have the following code for the editor field:

       piklist('field', array(
          'type' => 'editor',
          'field' => 'tc_education_editor', // This is the field name of the WordPress default editor
          'label' => 'Program Boxes',
          'scope' => 'page',
          'template' => 'field', // Only display the field not the label
          'options' => array( // Pass any option that is accepted by wp_editor()
            'wpautop' => true,
            'media_buttons' => true,
            'shortcode_buttons' => true,
            'teeny' => false,
            'dfw' => false,
            'quicktags' => true,
            'drag_drop_upload' => true,
            'tinymce' => array(
              'resize' => false,
              'wp_autoresize_on' => true
            )
          )
        ));

      When I try to add a Piklist shortcode (using the shortcode button) the shortcode winds up saving to the standard page editor field and not the Piklist field. Any help you can give on this is greatly appreciated. Thanks!

      Also I originally had it set-up with the scope to Post and then changed to page to see if that would work. I’m pretty sure that it should always be post (unless its a CPT) but figured I’d try to cover all the bases.

    • #6952
      Steve
      Keymaster

      @upside– Always great to hear from Piklist fans!

      scope does a lot, but in simplest terms, it tells Piklist where to save data.

      "scope" => "post": saves to wp_post table
      "scope" => "page": does nothing since the table doesn’t exist.

      In your case, the editor field is actually post_meta:
      "scope" => "post_meta"

      Or if you’re in the admin you can just leave it out since Piklist is smart enough to figure it out.

    • #6956
      upside
      Member

      @steve thanks for the clarification. Unfortunately even when I change to scope => ‘post_meta” or leave blank the shortcode is still saving to the wrong editor field. On that page I have two editor fields the default (the_content) field and then the Piklist field as seen in the code above (tc_education_editor). When I try to save a piklist shortcode using the shortcode button it winds up saving into the_content field.

      Is there something that I’m missing that I’ve set up wrong in the editor field code? Thanks as always for your help, you guys are awesome as is Piklist!

    • #6972
      Steve
      Keymaster

      @upside– can you email your plugin to [email protected] Happy to take a look.

    • #6997
      Steve
      Keymaster
      This reply has been marked as private.
Viewing 4 reply threads
  • You must be logged in to reply to this topic.