Skip to content

Instantly share code, notes, and snippets.

@tfnab
Created March 20, 2015 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfnab/78484884d62846871a44 to your computer and use it in GitHub Desktop.
Save tfnab/78484884d62846871a44 to your computer and use it in GitHub Desktop.
WP Plugin für Frank
<?php
/*
Plugin Name: Frank
*/
function frank_init()
{
add_shortcode( 'frank', 'frank_shortcode_frank' );
}
add_action( 'init', 'frank_init' );
function frank_shortcode_frank( $a, $c )
{
$a = shortcode_atts( array(
'faktor' => '',
), $a );
if ( empty( $c ) ) $c = 'Frank';
return $a['faktor'].' cooler typ, dieser '.$c;
}
// Usage: [frank] or [frank faktor=sehr]Martin[/frank] ;-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment