WordPress.org

Ready to get started?Download WordPress

Forums

Artiss Plugins List
Erroneous paragraph tags issue still not fixed (19 posts)

  1. Steven Vachon
    Member
    Posted 2 years ago #

    <ul>[plugins_list cache="no" format='<li>#Title#</li>']</ul>

    produces:

    <ul><li>Plugin Name</li><p></p></ul>

  2. dartiss
    Member
    Plugin Author

    Posted 2 years ago #

    This is not an issue with the plugin, as it does not add any such tags to the content. Please check the extra tags are not present within the shortcode by looking at the post/page in the HTML editor.

    If not present, it may be your theme incorrectly inserting them.

    David.

  3. Steven Vachon
    Member
    Posted 2 years ago #

    I just edited my post with how I'm using this plugin in my content

  4. dartiss
    Member
    Plugin Author

    Posted 2 years ago #

    And I'm assuming the HTML Editor view is no different?

    If so, I'd try the following (if you can)...

    • Look in your site's Writing settings. The 2nd one down is named "WordPress should correct invalidly nested XHTML automatically". Is this ticked? If so, try unticking it and see if the problem goes away.
    • Disable all other plugins. Again, check to see if this resolves the issue.
    • If the above two fail then you can try switching, just for the moment, to another theme, such as Twenty Twelve.

    As I've said my plugin doesn't do anything to add those extra tags so I can only assume something else is adding them in.

    David.

  5. Steven Vachon
    Member
    Posted 2 years ago #

    Automatic XHTML correction was already disabled. When disabling all other plugins, it still inserts the additional <p> tags.

    The old versions of this plugin worked fine.

    I have my WordPress installed to a sub-directory, in case you haven't tested that scenario. Here is the page in question: http://www.svachon.com/about-this-site/

  6. Steven Vachon
    Member
    Posted 1 year ago #

    Also, the issue remains when using the Twenty Twelve theme.

  7. Steven Vachon
    Member
    Posted 1 year ago #

    OK, I found some time to investigate it myself. The problem appears to be in WordPress itself.

    <ul>[plugins_list cache="no" format='<li>#Title#</li>'/]</ul>

    function apl_plugins_list_shortcode( $paras ) {
    
    	print_r( htmlspecialchars($paras['format']) );
    
    	extract( shortcode_atts( array( 'format' => '', 'show_inactive' => '', 'cache' => '', 'nofollow' => '', 'target' => '' ), $paras ) );
    
    	print_r( htmlspecialchars($format) );
    
    	$output = get_plugins_list( $format, $show_inactive, $cache, $nofollow, $target );
    
    	return $output;
    }

    It adds the <p>

    We'll see how this goes: http://core.trac.wordpress.org/ticket/23694

  8. dartiss
    Member
    Plugin Author

    Posted 1 year ago #

    It doesn't add it to mine or any of WP sites I run, though, so I suspect either a WordPress configuration issue or theme/plugin problem.

    I see from the code above you've added some output to the plugin. At what stage is the paragraph tag appearing?

    David.

  9. Steven Vachon
    Member
    Posted 1 year ago #

    Well, it's a fresh WordPress installation with all other plugins disabled and using Twenty Twelve theme. The paragraph tag is added immediately after using the shortcode, so it must be WordPress related.

  10. dartiss
    Member
    Plugin Author

    Posted 1 year ago #

    You've added 2 print_r statements to the above code - are you saying the paragraph tag appears when the first print_r is displayed?

    David.

  11. Steven Vachon
    Member
    Posted 1 year ago #

    Yes.

  12. dartiss
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, this would suggest that the paragraph tags are being added when the shortcode is being processed by WP. A quick Google shows lots of people having such issues with shortcode processing and it appears to be related to the sequence in which WordPress runs a filter routine.

    The following link best summarises it - best to read the comments too.

    http://wpforce.com/prevent-wpautop-filter-shortcode/

    The conclusion appears to be that the problem should not be happening unless the processing priorities have been changed.

    David.

  13. Steven Vachon
    Member
    Posted 1 year ago #

    I have not altered processing priority values.

  14. dartiss
    Member
    Plugin Author

    Posted 1 year ago #

    Ok. But in that case I'm not sure how I can help further - as you've identified this is a WordPress problem.

    David.

  15. Steven Vachon
    Member
    Posted 1 year ago #

    Yeah, I know, you're right. I'm hoping the WordPress team has good news in the future.

  16. esmi
    Forum Moderator
    Posted 1 year ago #

    I help to maintain a plugin that makes extensive use of more than 12 custom shortcodes and we are not seeing anything like this. So I humbly suggest that the issue is in the plugin - not WordPress core.

  17. dartiss
    Member
    Plugin Author

    Posted 1 year ago #

    esmi - did you read the link further up in the discussion?

    What Steven has found is that the first line of the function, called by add_shortcode, the paragraph tags have been added. My plugin has not done anything at this stage to be able to add them.

    David.

  18. esmi
    Forum Moderator
    Posted 1 year ago #

    I did read that but it only shows the shortcode being parsed - not how the shortcode was created or called by the plugin. If it helps, the eShop plugin has quite a few list-based shortcodes (in the unimaginatively entitled eshop-shortcodes.php file). Perhaps if you did a comparison, you'd be able to figure out why your shortcode has this issue and ours don't.

  19. dartiss
    Member
    Plugin Author

    Posted 1 year ago #

    I've written a number of plugins and most use shortcodes - I've implemented this no differently. That would also not explain why I am (and I assume the majority of those people using this plugin) not seeing this problem myself.

    Don't get me wrong, I've never blamed this on WordPress core. It's the poster who believes it is this to blame as he's adamant that his theme or plugins aren't to blame.

    David.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.