Hello akinorukul.
Unfortunately the plugin doesn’t currently support setting the ‘styles’ with the shortcode. Instead what you could do is write your own shortcode and put the function you pasted over into that shortcode.
Would that be an option?
Hello Leon,
why not, I tried :
function custom_pronamic_google_maps_the_content( $atts, $content=null ) {
$content .= pronamic_google_maps( array(
'width' => 955,
'height' => 400,
'map_options' => array(
'styles' => array(
(object) array(
'stylers' => array(
(object) array( 'saturation' => '-100' ),
)
),
)
)
) );
return $content;
}
//add_filter( 'the_content', 'custom_pronamic_google_maps_the_content', 9 );
add_shortcode( 'custom_googlemaps', 'custom_pronamic_google_maps_the_content' );
and used [custom_googlemaps] in my post but it doesn’t work.
Am I missing something ?
You need to set ‘echo’ argument to false:
function custom_pronamic_google_maps_the_content( $atts, $content=null ) {
$content .= pronamic_google_maps( array(
'echo' => false,
'width' => 955,
'height' => 400,
'map_options' => array(
'styles' => array(
(object) array(
'stylers' => array(
(object) array( 'saturation' => '-100' ),
)
),
)
)
) );
return $content;
}
//add_filter( 'the_content', 'custom_pronamic_google_maps_the_content', 9 );
add_shortcode( 'custom_googlemaps', 'custom_pronamic_google_maps_the_content' );