Forum Replies Created
-
AuthorPosts
-
creremParticipant
Hi,
I’m doing the plugin for ThemeForrest and in their guidelines they ask to not remove the wpautop filter. The guys that will do the review are not gonna investigate too much the problem – they will just reject it. That’s why i was trying to not use this solution. The alternative will be to useget_post_field( 'post_excerpt',..)
and see if the Gutenberg team will consider this a issue or not.Thank you again for taking the time to look over this.
creremParticipantSo, is this a bug or expected behavior ? Any solutions for this situation -( removing the filter is not acceptable on places like themeforest ).
Thank you for your help.creremParticipant🙂 i think i found it, It happens in your 12-dynamic example also.(maybe you can confirm it for me )
If you use get_the_excerpt() (and i think get_the_content() also ) it will trigger the wpautop filter.
For ex
foreach ( $recent_posts as $post ) { $post_id = $post['ID']; $markup .= get_the_excerpt($post_id).sprintf( '<li> <a href="%1$s">%2$s</a> line1 line2 </li>', esc_url( get_permalink( $post_id ) ), esc_html( get_the_title( $post_id ) ) ); } $markup.='</ul>';
Here is a screenshot http://prntscr.com/luhguk
Can you confirm my findings ? Thank you
creremParticipantHi,
The same html markup but hard coded is displayed correct. The php generated markup is not . Looking at my php function i think that. myabe, using the ob_start() and ob_get_contents php function could be the problem. This is the code that generated the output.ob_start(); while ($recent_posts->have_posts()): $recent_posts->the_post(); if($type == 'estate_property'){ get_template_part('templates/property_unit'.$property_card_type_string); } else { if(isset($attributes['align']) && $attributes['align']=='horizontal'){ get_template_part('templates/blog_unit'); }else{ get_template_part('templates/blog_unit2'); } } endwhile; $templates = ob_get_contents(); ob_end_clean();
creremParticipantHi,
Let me some tests with hard coded html and will get back to you.
ThankscreremParticipantHi Zac,
Yes, “number” works.
Thank you -
AuthorPosts