about-widget.php
6 years ago
accordion-widget.php
6 years ago
accordion.php
6 years ago
attachment-url.php
6 years ago
audio.php
6 years ago
before-after.php
6 years ago
button.php
6 years ago
code.php
6 years ago
contact-box.php
6 years ago
contact-form.php
6 years ago
custom-list.php
6 years ago
divider.php
6 years ago
dropcap.php
6 years ago
facebook.php
6 years ago
flickr.php
6 years ago
gallery.php
6 years ago
general-element-fields.php
6 years ago
gmap.php
6 years ago
highlight.php
6 years ago
image.php
6 years ago
instagram-feed.php
6 years ago
latest-items.php
8 years ago
latest-posts-slider.php
6 years ago
popular-posts-widget.php
6 years ago
quote.php
6 years ago
recent-posts-grid-carousel.php
6 years ago
recent-posts-land-style.php
6 years ago
recent-posts-masonry.php
6 years ago
recent-posts-tiles-carousel.php
6 years ago
recent-posts-tiles.php
6 years ago
recent-posts-timeline.php
6 years ago
recent-posts-widget.php
6 years ago
recent-products.php
6 years ago
related-posts.php
8 years ago
sample-element.php
6 years ago
search.php
6 years ago
socials-list.php
6 years ago
staff.php
6 years ago
tab-widget.php
6 years ago
tabs.php
6 years ago
testimonial.php
6 years ago
text.php
6 years ago
touch-slider.php
6 years ago
video.php
6 years ago
about-widget.php
261 lines
| 1 | <?php |
| 2 | /** |
| 3 | * About element |
| 4 | * |
| 5 | * |
| 6 | * @package Auxin |
| 7 | * @license LICENSE.txt |
| 8 | * @author averta |
| 9 | * @link http://phlox.pro/ |
| 10 | * @copyright (c) 2010-2020 averta |
| 11 | */ |
| 12 | |
| 13 | function get_auxin_about_widget( $master_array ) { |
| 14 | |
| 15 | $master_array['aux_about_widget'] = array( |
| 16 | 'name' => __("About Author", 'auxin-elements' ), |
| 17 | 'auxin_output_callback' => 'auxin_widget_about_callback', |
| 18 | 'base' => 'aux_about_widget', |
| 19 | 'description' => __('It adds an about author element.', 'auxin-elements' ), |
| 20 | 'class' => 'aux-widget-about', |
| 21 | 'show_settings_on_create' => true, |
| 22 | 'weight' => 1, |
| 23 | 'is_widget' => true, |
| 24 | 'is_shortcode' => true, |
| 25 | 'is_so' => false, |
| 26 | 'is_vc' => false, |
| 27 | 'category' => THEME_NAME, |
| 28 | 'group' => '', |
| 29 | 'admin_enqueue_js' => '', |
| 30 | 'admin_enqueue_css' => '', |
| 31 | 'front_enqueue_js' => '', |
| 32 | 'front_enqueue_css' => '', |
| 33 | 'icon' => 'aux-element aux-pb-icons-about', |
| 34 | 'custom_markup' => '', |
| 35 | 'js_view' => '', |
| 36 | 'html_template' => '', |
| 37 | 'deprecated' => '', |
| 38 | 'content_element' => '', |
| 39 | 'as_parent' => '', |
| 40 | 'as_child' => '', |
| 41 | 'params' => array( |
| 42 | array( |
| 43 | 'heading' => __('Title','auxin-elements' ), |
| 44 | 'description' => '', |
| 45 | 'param_name' => 'title', |
| 46 | 'type' => 'textfield', |
| 47 | 'value' => '', |
| 48 | 'def_value' => '', |
| 49 | 'holder' => 'textfield', |
| 50 | 'class' => 'id', |
| 51 | 'admin_label' => true, |
| 52 | 'dependency' => '', |
| 53 | 'weight' => '', |
| 54 | 'group' => '' , |
| 55 | 'edit_field_class' => '' |
| 56 | ), |
| 57 | array( |
| 58 | 'heading' => __('Name','auxin-elements' ), |
| 59 | 'description' => __('The name which appears in about widget.', 'auxin-elements' ), |
| 60 | 'param_name' => 'name', |
| 61 | 'type' => 'textfield', |
| 62 | 'value' => '', |
| 63 | 'holder' => 'textfield', |
| 64 | 'class' => 'title', |
| 65 | 'admin_label' => true, |
| 66 | 'dependency' => '', |
| 67 | 'weight' => '', |
| 68 | 'group' => '' , |
| 69 | 'edit_field_class' => '' |
| 70 | ), |
| 71 | array( |
| 72 | 'heading' => __('Skills','auxin-elements' ), |
| 73 | 'description' => __('It appears below the name.', 'auxin-elements' ), |
| 74 | 'param_name' => 'skills', |
| 75 | 'type' => 'textfield', |
| 76 | 'value' => '', |
| 77 | 'holder' => 'textfield', |
| 78 | 'class' => 'skills', |
| 79 | 'admin_label' => true, |
| 80 | 'weight' => '', |
| 81 | 'group' => '', |
| 82 | 'edit_field_class' => '' |
| 83 | ), |
| 84 | array( |
| 85 | 'heading' => __('Info','auxin-elements' ), |
| 86 | 'description' => __('Biographical info or any other content.', 'auxin-elements' ), |
| 87 | 'param_name' => 'info', |
| 88 | 'type' => 'textarea_html', |
| 89 | 'def_value' => '', |
| 90 | 'value' => '', |
| 91 | 'holder' => 'div', |
| 92 | 'class' => 'info', |
| 93 | 'admin_label' => false, |
| 94 | 'dependency' => '', |
| 95 | 'weight' => '', |
| 96 | 'group' => '' , |
| 97 | 'edit_field_class' => '' |
| 98 | ), |
| 99 | array( |
| 100 | 'heading' => __('Image','auxin-elements' ), |
| 101 | 'description' => __('It appears above the name.', 'auxin-elements' ), |
| 102 | 'param_name' => 'about_image', |
| 103 | 'type' => 'attach_image', |
| 104 | 'value' => '', |
| 105 | 'def_value' => '', |
| 106 | 'holder' => 'textfield', |
| 107 | 'class' => 'about_image', |
| 108 | 'admin_label' => true, |
| 109 | 'dependency' => '', |
| 110 | 'weight' => '', |
| 111 | 'group' => '' , |
| 112 | 'edit_field_class' => '' |
| 113 | ), |
| 114 | array( |
| 115 | 'heading' => __('Image style','auxin-elements' ), |
| 116 | 'description' => '', |
| 117 | 'param_name' => 'image_style', |
| 118 | 'type' => 'dropdown', |
| 119 | 'def_value' => 'circle', |
| 120 | 'value' => array( |
| 121 | 'circle' => __('Circle', 'auxin-elements' ), |
| 122 | 'square' => __('Square', 'auxin-elements' ) |
| 123 | ), |
| 124 | 'holder' => '', |
| 125 | 'class' => 'image_style', |
| 126 | 'admin_label' => true, |
| 127 | 'dependency' => '', |
| 128 | 'weight' => '', |
| 129 | 'group' => '' , |
| 130 | 'edit_field_class' => '' |
| 131 | ), |
| 132 | array( |
| 133 | 'heading' => __('Align center texts', 'auxin-elements' ), |
| 134 | 'description' => '', |
| 135 | 'param_name' => 'align_center', |
| 136 | 'type' => 'aux_switch', |
| 137 | 'def_value' => '', |
| 138 | 'value' => '1', |
| 139 | 'holder' => '', |
| 140 | 'class' => 'align_center', |
| 141 | 'admin_label' => true, |
| 142 | 'dependency' => '', |
| 143 | 'weight' => '', |
| 144 | 'group' => '' , |
| 145 | 'edit_field_class' => '' |
| 146 | ), |
| 147 | array( |
| 148 | 'heading' => __('Show socials below the info','auxin-elements' ), |
| 149 | 'description' => '', |
| 150 | 'param_name' => 'show_socials', |
| 151 | 'type' => 'aux_switch', |
| 152 | 'def_value' => '', |
| 153 | 'value' => '0', |
| 154 | 'holder' => '', |
| 155 | 'class' => 'show_socials', |
| 156 | 'admin_label' => true, |
| 157 | 'dependency' => '', |
| 158 | 'weight' => '', |
| 159 | 'group' => '' , |
| 160 | 'edit_field_class' => '' |
| 161 | ), |
| 162 | array( |
| 163 | 'heading' => __('Extra class name','auxin-elements' ), |
| 164 | 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'auxin-elements' ), |
| 165 | 'param_name' => 'extra_classes', |
| 166 | 'type' => 'textfield', |
| 167 | 'value' => '', |
| 168 | 'def_value' => '', |
| 169 | 'holder' => 'textfield', |
| 170 | 'class' => 'extra_classes', |
| 171 | 'admin_label' => true, |
| 172 | 'dependency' => '', |
| 173 | 'weight' => '', |
| 174 | 'group' => '' , |
| 175 | 'edit_field_class' => '' |
| 176 | ) |
| 177 | |
| 178 | ) |
| 179 | ); |
| 180 | |
| 181 | return $master_array; |
| 182 | } |
| 183 | |
| 184 | add_filter( 'auxin_master_array_shortcodes', 'get_auxin_about_widget', 10, 1 ); |
| 185 | |
| 186 | /** |
| 187 | * The front-end output of this element is returned by the following function |
| 188 | * |
| 189 | * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above. |
| 190 | * @param string $shortcode_content The shorcode content |
| 191 | * @return string The output of element markup |
| 192 | */ |
| 193 | function auxin_widget_about_callback( $atts, $shortcode_content = null ){ |
| 194 | |
| 195 | // Defining default attributes |
| 196 | $default_atts = array( |
| 197 | 'title' => '', |
| 198 | 'about_image' => '', |
| 199 | 'show_socials' => '0', |
| 200 | 'image_style' => 'square', |
| 201 | 'align_center' => '1', |
| 202 | 'info' => '', |
| 203 | 'name' => '', |
| 204 | 'skills' => '', |
| 205 | |
| 206 | 'extra_classes' => '', |
| 207 | 'custom_el_id' => '', // custom id attribute for this element |
| 208 | 'base_class' => 'aux-widget-about' // base class name for container |
| 209 | ); |
| 210 | |
| 211 | $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content ); |
| 212 | extract( $result['parsed_atts'] ); |
| 213 | |
| 214 | ob_start(); |
| 215 | |
| 216 | // widget header ------------------------------ |
| 217 | echo $result['widget_header']; |
| 218 | echo $result['widget_title']; |
| 219 | ?> |
| 220 | |
| 221 | |
| 222 | <div class="<?php echo ($align_center ? 'aux-text-center' : ''); ?>"> |
| 223 | |
| 224 | <!--- The output for element here --> |
| 225 | <?php |
| 226 | |
| 227 | if ( !empty( $about_image ) && is_numeric( $about_image ) ) { |
| 228 | echo '<div class="aux-about-image aux-style-' . $image_style . '">' . auxin_get_the_resized_attachment( $about_image, 240, ( $image_style == 'square' ? 400 : 240 ), true ) . '</div>'; |
| 229 | } |
| 230 | |
| 231 | echo '<dl>'; |
| 232 | |
| 233 | if ( !empty( $name ) ) { |
| 234 | echo '<dt class="aux-about-name">' . $name . '</dt>'; |
| 235 | } |
| 236 | |
| 237 | if ( !empty( $skills ) ) { |
| 238 | echo '<dd class="aux-about-skills">' . $skills . '</dd>'; |
| 239 | } |
| 240 | |
| 241 | if ( !empty( $info ) ) { |
| 242 | echo '<dd class="aux-about-content">'.$info.'</dd>'; |
| 243 | } |
| 244 | |
| 245 | echo '</dl>'; |
| 246 | |
| 247 | if( $show_socials ) { |
| 248 | echo auxin_the_socials(); |
| 249 | } |
| 250 | ?> |
| 251 | |
| 252 | </div><!-- widget-inner --> |
| 253 | |
| 254 | |
| 255 | <?php |
| 256 | // widget footer ------------------------------ |
| 257 | echo $result['widget_footer']; |
| 258 | |
| 259 | return ob_get_clean(); |
| 260 | } |
| 261 |