[Dev] add filter after WordPress formatting
-
Hi there,
the ads were not inserted into my posts because I simply don’t format each post with
<p>. WordPress is doing that for me with the formatting function wpautop. Therefore my HTML is fine with<p>'son the frontend.
So what’s the point? Your plugin hooks into the_content before the<p>are automatically added but also checks for<p>. In my case at that point in time there are 0<p>and so the plugin doesn’t adds an ad.
The reason for this is that wpautop has the priority 12 and your filter forthe_content10 (default priority).In summary please change
add_filter('the_content', 'process_content');
to
add_filter('the_content', 'process_content', 25);
The topic ‘[Dev] add filter after WordPress formatting’ is closed to new replies.