EstudioJuridicoAlmagro_Web/www/wpv_common/shortcodes/buttons.php
david f72df580c3 - Importación inicial
- Ticket 1166 -> Orden de los idiomas ES FR EN RU

git-svn-id: https://192.168.0.254/svn/Proyectos.EstudioJuridicoAlmagro_Web/trunk@2 c22fe52d-42d7-ba4f-95f7-33effcf65713
2013-02-27 15:39:05 +00:00

49 lines
1.1 KiB
PHP

<?php
/**
* displays a button
*/
function wpv_shortcode_button($atts, $content = null, $code) {
extract(shortcode_atts(array(
'id' => false,
'class' => false,
'size' => 'small',
'font' => '',
'link' => '',
'linktarget' => '',
'color' => '',
'bgcolor' => '',
'align' => false,
), $atts));
$id = $id ? ' id="' . $id . '"' : '';
$class = $class ? ' '.$class : ' button';
$link = $link ? ' href="' . $link . '"' : '';
$linktarget = $linktarget ? ' target="' . $linktarget . '"' : '';
// inline styles for the button
$color = $color ? "color: $color;" : '';
$font = $font ? "font-size: {$font}px;" : '';
$style = ($color != '' || $font != '')? " style='$color $font'" : '';
$aligncss = ($align != 'center') ? ' align'.$align : '';
$content = '<a'.
$id.
$link.
$linktarget.
$style.
' class="'.
"$size $bgcolor $class $aligncss".
'"><span>' . trim($content) . '</span></a>';
$content = "[raw]".$content."[/raw]";
if($align === 'center')
return '<p class="center">'.$content.'</p>';
else
return $content;
}
add_shortcode('button', 'wpv_shortcode_button');