WordPress.org

Ready to get started?Download WordPress

Forums

issue with add_shortcode extacting $atts parameter (1 post)

  1. pgn4web
    Member
    Posted 1 year ago #

    in my plugin I use add_shortcode to create a custom BBcode:

    add_shortcode( 'pgn' , array(&$this, 'shortcode_pgn') );
    
    function shortcode_pgn( $atts = array(), $content = NULL ) {
    }

    It used to work like a charm, extracting BBcode parameters using the $atts array. Recently, with no relevant changes in the plugin (so it must be a wordpress.org update, now I'm using 3.4.2, but the bug migh have been unnoticed for a while) the plugin behaves incorrectly, it seems parameters are not captured correctly in $atts. Specifically, the value of the last supplied parameters is not read correctly and the values of the previous parameter is read instead.

    For example, with

    [pgn height=460 ss=40 h=320 eo=t hd=l am=n ih=e rm=1
    pd=/data/file.pgn xxx=yyy]

    the value $atts['xxx'] is not 'yyy' but '/data/file.pgn'

    Has anyone seen the same issue?
    Or any way to verify and fix the issue?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic