DavidLibeau/mastodon-tools

WP plugin: Using content instead additional attribute

ginsterbusch opened this issue · 0 comments

Nice one, but why dont you just use the content instead having to use a separate attribute called URL?

ie. something like this:

[mastodon]https://mastodon.xyz/@David/15605[/mastodon]

Code for this (untested, but I work on stuff like this on a daily base):

function mastodon_embed_callback( $atts = array(), $content= null ) {
if( !empty( $content ) ) {
$url = esc_url( strip_tags( $content ) );
}
...
}