Skip to content
Snippets Groups Projects
Commit 21fc846f authored by Lauren's avatar Lauren
Browse files

Changed button classes to prevent conflicts with other themes, plugins etc....

Changed button classes to prevent conflicts with other themes, plugins etc. Changed labels of popup 'add button' window. Added custom button class and full width option to insert window
parent b96576ec
No related branches found
No related tags found
No related merge requests found
......@@ -24,11 +24,11 @@
name: 'type',
label: 'Button Type',
'values': [
{text: 'Default', value: 'default'},
{text: 'Primary', value: 'primary'},
{text: 'Action', value: 'action'},
{text: 'Warning', value: 'warning'},
{text: 'Info', value: 'info'}
{text: 'Default', value: 'lbdesign_type_default'},
{text: 'Primary', value: 'lbdesign_primary'},
{text: 'Action', value: 'lbdesign_action'},
{text: 'Warning', value: 'lbdesign_warning'},
{text: 'Info', value: 'lbdesign_info'}
]
},
{type: 'listbox',
......
......@@ -11,12 +11,21 @@
/* our main shortcode function */
function lbdesign_button($atts, $content = null) {
$atts = shortcode_atts(array(
<<<<<<< b96576ece5a9af761cf8a31ef8f8331b3f62ee71
'link' => null,
'type' => 'default',
'color' => 'default',
'size' => 'default',
'style' => 'default',
'custom_class' => null,
=======
'link' => '#',
'type' => 'lbdesign_type_default',
'color' => '',
'size' => 'lbdesign_size_default',
'custom_class' => '',
'full_width' => '',
>>>>>>> Changed button classes to prevent conflicts with other themes, plugins etc. Changed labels of popup 'add button' window. Added custom button class and full width option to insert window
), $atts, 'lbdesign_button');
// check if we want the button to be full width. if yes, set up lbdesign_full_width class. if not, leave empty
......@@ -26,6 +35,7 @@ function lbdesign_button($atts, $content = null) {
$full_width = '';
}
<<<<<<< b96576ece5a9af761cf8a31ef8f8331b3f62ee71
foreach ($atts as $key => $att) {
if( $key !== 'link' && $att !== null && $att !== '' && $att !== 'default' ) {
......@@ -34,6 +44,9 @@ function lbdesign_button($atts, $content = null) {
}
return '<a class="lbdesign_button '.implode($classes, " ").' '.$full_width.'" href="'.$atts['link'].'">'.do_shortcode($content).'</a>';
=======
return '<a class="lbdesign_button ' . $atts['type'] . ' ' . $atts['color'] . ' ' . $atts['size'] . ' ' . $atts['custom_class'] . $full_width . '" href="'.$atts['link'].'">' . do_shortcode($content) . '</a>';
>>>>>>> Changed button classes to prevent conflicts with other themes, plugins etc. Changed labels of popup 'add button' window. Added custom button class and full width option to insert window
}
add_shortcode('button', 'lbdesign_button');
......
/* DEFAULT button shortcode styles */
a.button {
background: #ccc;
color: #fff;
text-decoration: none;
font-weight: bold;
padding: 20px 25px;
display: inline-block;
text-transform: uppercase;
margin: 5px 5px 5px 0;
border: 0;
&:hover,
&:focus {
background: darken(#ccc, 10%);
}
/* SIZE button styles */
&.small {
padding: 10px 15px;
font-size: 0.9em;
}
&.large {
padding: 30px 35px;
font-size: 1.2em;
}
/* TYPE button styles */
&.primary {
background: #226CFF;
&:hover,
&:focus {
background: darken(#226CFF, 10%);
}
}
&.warning {
background: #FF2247;
&:hover,
&:focus {
background: darken(#FF2247, 10%);
}
}
&.info {
background: #FFDA22;
&:hover,
&:focus {
background: darken(#FFDA22, 10%);
}
}
&.action {
background: #4FBE00;
&:hover,
&:focus {
background: darken(#4FBE00, 10%);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment