Création d’un shortcode

<?php

class my_shortcode{

	public static function hooks(){
		add_shortcode('shortcode_name', array(__CLASS__,'shortcode_handler'));
	}
	
	public static function shortcode_handler( $atts, $content = '' ) {
		global $post;
		
		$html = '';
		
		extract( shortcode_atts( array(
			'arg1' => 'default value 1',
			'arg2' => '',
		), $atts ) );
		
		$content = trim($content);
		
		$html = "Something". $content ."something else.";
				
		return $html;
	}
	
}

my_shortcode::hooks();