Tagged: , ,

Viewing 4 reply threads
  • Author
    Posts
    • #1400
      preston
      Member
        piklist('field', array(
          'type' => 'editor'
          ,'field' => 'home-description'
          ,'label' => 'Description'
          ,'description' => 'Additional home details.'
          ,'value' => ''
          ,'template' => 'field'
          ,'options' => array(
            'wpautop' => true
            ,'media_buttons' => false
          )
          ,'on_post_status' => array(
            'value' => 'lock'
          )
        ));

      <?php echo get_post_meta($homeID, 'home-description', true); ?>

      However, <p> tags are not being added to the output.

      Any ideas?

      WordPress 3.8.1
      Piklist 0.9.2

    • #1402
      Kevin
      Keymaster

      The wpautop is an option for the editor itself and doesn’t affect the output. I think what your looking for is something like this?

      <?php echo wpautop(get_post_meta($homeID, 'home-description', true)); ?>

      Thanks,

      Kevin

    • #1403
      preston
      Member

      Ah yep, that’s exactly what I was looking for.

      Thanks!

    • #2430
      Simon
      Member

      So what does the wpautop option actually do then if it doesn’t affect the output?

    • #2433
      Steve
      Keymaster

      @simon– There are TWO wpautop functions in WordPress… one PHP and one Javascript. What Kevin showed you is for PHP output. The wpautop parameter controls paragraph breaks in the editor. Here’s a little movie I put together to demonstrate.

Viewing 4 reply threads
  • The topic ‘Editor field wpautop option not working?’ is closed to new replies.