I made a basic shordcode
function map_test(){
$map_render = '<p>test</p>';
return $map_render;
}
add_shortcode( 'map_shortcode', 'map_test' );
and the shortcode is created and all works fine until i do
if ( shortcode_exists( 'map_shortcode' ) ) {
echo do_shortcode('[map_shortcode]');
}
i get the
Test
rendered but after the element there is also a number 1 with double quotes
So i was wondering why is that “1” there and what made it render, also how to remove it?
Try the following to check short code existence and remove the same:
So the solution was to remove the ‘echo’ from echo do_shortcode, and the “1” is removed, ty all for your time.