1
votes

i have simple wordpress shortcode plugin code below, and also i have Wordpress SEO Yoast enabled :

function simplefunc()
{
    global $wpdb;
    $wpdb->query("insert into `anytable` (`column1`) values ('13')");
    return '';
}

add_shortcode( 'yourshortcode', 'simplefunc' );

and i'm executing, then the result was i have 2 entry in my anytable,

the query above run twice.

anyone know what's wrong with my code?

Any help would be greatly appreciated..

Thanks,

Andi

1

1 Answers

0
votes

Even I had this issue on my webiste. I have deactivated the plugins and re-activated again. Then my problem got solved. Try and see yourself.