'; } add_shortcode ('clear', 'clearboth_shortcode'); function clearleft_shortcode() { return '
'; } add_shortcode ('clearleft', 'clearleft_shortcode'); function clearright_shortcode() { return ''; } add_shortcode ('clearright', 'clearright_shortcode'); // Add shortcode for smaller text function smalltext_shortcode_handler( $atts, $content=null ) { return '' . $content . ''; } add_shortcode( 'small', 'smalltext_shortcode_handler' ); // Add MLA style "Works Cited" section // function d12mlaworks_cited( $atts , $content = null ) { return 'Works Cited
' . $content . 'Works Cited
'; } add_shortcode( 'mla-start', 'd12mlaworks_cited_start' ); // End MLA style "Works Cited" section // function d12mlaworks_cited_end( $atts , $content = null ) { return '' . $author . $authorend . '' . $title . $titleend . ' ' . $city . ': ' . $publisher . ', ' . $year . '. ' . $medium . $mediumend . $addt . '
'); } add_shortcode( 'mlabook', 'd12mlabook_shortcode' ); // Add "d12mlajournal" shortcode for "Works Cited" section // function d12mlajournal_shortcode( $atts ) { extract( shortcode_atts( array( 'author' => '', 'title' => '', 'journal' => '', 'volume' => '', 'issue' => '', 'year' => '', 'pages' => '', 'medium' => '', 'addt' => '', ), $atts ) ); $etitle = substr($title,-1); $titleend = "."; switch($etitle) { case "!": $titleend = ""; break; case "?": $titleend = ""; break; } if ($author == null) {$authorend = "";} else {$authorend = ". ";} if ($addt == null) {$mediumend = ".";} else {$mediumend = ". ";} return html_entity_decode( '' . $author . $authorend . '“' . $title . $titleend . '” ' . '' . $journal . '. ' . $volume . '.' . $issue . ' (' . $year . '): ' . $pages . '. ' . $medium . $mediumend . $addt . '
'); } add_shortcode( 'mlajournal', 'd12mlajournal_shortcode' ); // Add "d12mlamagazine" shortcode for "Works Cited" section // function d12mlamagazine_shortcode( $atts ) { extract( shortcode_atts( array( 'author' => '', 'title' => '', 'magazine' => '', 'date' => '', 'pages' => '', 'medium' => '', 'addt' => '', ), $atts ) ); $etitle = substr($title,-1); $titleend = "."; switch($etitle) { case "!": $titleend = ""; break; case "?": $titleend = ""; break; } if ($author == null) {$authorend = "";} else {$authorend = ". ";} if ($addt == null) {$mediumend = ".";} else {$mediumend = ". ";} return html_entity_decode( '' . $author . $authorend . '“' . $title . $titleend . '” ' . '' . $magazine . '. ' . $date . ': ' . $pages . '. ' . $medium . $mediumend . $addt . '
'); } add_shortcode( 'mlamagazine', 'd12mlamagazine_shortcode' ); // Add note paragraph function d12citationnote_shortcode_handler( $atts, $content=null, $code="" ) { return '' . $content . '
'; } add_shortcode( 'note' , 'd12citationnote_shortcode_handler' ); // Add a highlighting shortcode function d12highlightyellow_handler( $atts, $content=null ) { return '' . $content . ''; } add_shortcode( 'hly' , 'd12highlightyellow_handler' ); /* Register a TinyMCE button */ add_action( 'init', 'd12citations_buttons' ); function d12citations_buttons() { if ( current_user_can('edit_posts') && current_user_can('edit_pages') ) { add_filter( "mce_external_plugins", "d12mla_add_buttons" ); add_filter( 'mce_buttons_2', 'd12mla_register_buttons' ); } } function d12mla_add_buttons( $plugin_array ) { $plugin_array['d12mla'] = plugins_url( 'js/d12mla.js', __FILE__ ); return $plugin_array; } function d12mla_register_buttons( $buttons ) { array_push( $buttons, 'd12-mla-button' ); return $buttons; }