• Hey. Was just wondering why on one page it kept forcing out the viewcounts and came across this code on the shortcode class on _validate_args()

    if ( isset( $args['showviews'] ) ) { // showviews (true/false - default=false)
    	$args['showviews'] = true;
    } else {
    	$args['showviews'] = false;
    }

    That’s kinda annoying in the sense that even if you have set showviews=”false” it’s still set, and thus this forces it to be true.

    If you want to handle the default like this I guess something along the lines of

    if ( isset( $args['showviews'] ) && $args['showviews'] !== false )

    would be better.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘About the shortcode class’ is closed to new replies.