Tagged: ,

Viewing 3 reply threads
  • Author
    Posts
    • #4706
      mcmaster
      Member

      For some reason, fields I’m retrieving via Piklist are now being backslashed. I’m pretty sure this started with 0.9.9.

      The field newsletter_highlights is part of an add-more group:

      array(
          'type' => 'editor',
          'field' => 'newsletter_highlights',
          'label' => __( 'Highlights of this issue' ),
          'columns' => 12,
          'options' => array (
              'media_buttons' => false,
              'teeny' => true,
          ),
      ),
      

      I’m using the Piklist loop to display each group:

        $newsletters = get_post_meta( $post->ID, 'newsletter_archive', true );
      ?>
      <div class="newsletter-list">
      <?php
        piklist( 'templates/newsletter-template', array( 'data' => $newsletters, 'loop' => 'data' ) );
      ?>
      

      And the template code uses wptexturize and wpautop:

      $highlights = wptexturize( wpautop( $data['newsletter_highlights'] ) );
      

      When I view the content in the editor, it looks fine:

      Highlights include the life of underwater 
      filmmaker and MRWC Board member Jeremy Monroe, 
      MRWC's financial picture, and an interview with Michael Pope.
      

      but on the page it displays as:

      Highlights include the life of underwater 
      filmmaker and MRWC Board member Jeremy Monroe, 
      MRWC\'s financial picture, and an interview with Michael Pope.
      

      Thanks,
      Donna

    • #4707
      mcmaster
      Member

      p.s. adding stripslashes to my processing is a workaround:

      $highlights = wptexturize( wpautop( stripslashes( $data['newsletter_highlights'] ) ) );
      
    • #4708
      mcmaster
      Member

      happening with double-quotes in text fields as well … just realized it’s adding slashes every time I save *urk*

      Attachments:
      You must be logged in to view attached files.
    • #4712
      Kevin
      Keymaster

      @mcmaster-

      This is fixed in the next beta release.

      Thanks,

      Kevin

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