PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / trunk
Shortcodes and extra features for Phlox theme vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elements / highlight.php
auxin-elements / includes / elements Last commit date
about-widget.php 5 months ago accordion-widget.php 1 month ago accordion.php 5 months ago attachment-url.php 5 months ago audio.php 5 months ago before-after.php 5 months ago button.php 5 months ago code.php 5 months ago contact-box.php 5 months ago contact-form.php 5 months ago custom-list.php 5 months ago divider.php 5 months ago dropcap.php 5 months ago facebook.php 5 months ago flickr.php 5 months ago gallery.php 5 months ago gmap.php 5 months ago highlight.php 5 months ago image.php 5 months ago instagram-feed.php 5 months ago latest-posts-slider.php 5 months ago popular-posts-widget.php 5 months ago products-grid.php 5 months ago quote.php 5 months ago recent-posts-grid-carousel.php 5 months ago recent-posts-land-style.php 5 months ago recent-posts-masonry.php 5 months ago recent-posts-tiles-carousel.php 5 months ago recent-posts-tiles.php 5 months ago recent-posts-timeline.php 5 months ago recent-posts-widget.php 5 months ago recent-products.php 5 months ago related-posts.php 8 years ago sample-element.php 5 months ago search.php 5 months ago socials-list.php 5 months ago staff.php 5 months ago tab-widget.php 5 months ago tabs.php 5 months ago testimonial.php 5 months ago text.php 5 months ago touch-slider.php 5 months ago video.php 5 months ago
highlight.php
149 lines
1 <?php
2 /**
3 * Hightlight text
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2026 averta
11 */
12 function auxin_get_highlight_master_array( $master_array ) {
13
14 $master_array['aux_highlight'] = array(
15 'name' => __("Highlight", 'auxin-elements' ),
16 'auxin_output_callback' => 'auxin_widget_highlight_callback',
17 'base' => 'aux_highlight',
18 'description' => __('Highlighted Text', 'auxin-elements' ),
19 'class' => 'auxin-widget-highlight',
20 'show_settings_on_create' => true,
21 'weight' => 1,
22 'is_widget' => false,
23 'is_shortcode' => true,
24 'category' => THEME_NAME,
25 'group' => '',
26 'admin_enqueue_js' => '',
27 'admin_enqueue_css' => '',
28 'front_enqueue_js' => '',
29 'front_enqueue_css' => '',
30 'icon' => '',
31 'custom_markup' => '',
32 'js_view' => '',
33 'html_template' => '',
34 'deprecated' => '',
35 'content_element' => '',
36 'as_parent' => '',
37 'as_child' => '',
38 'params' => array(
39 array(
40 'heading' => __('Divider style','auxin-elements' ),
41 'description' => __('The style of divider.','auxin-elements' ),
42 'param_name' => 'style',
43 'type' => 'aux_visual_select',
44 'std' => "aux-highlight-red",
45 'holder' => 'dropdown',
46 'class' => 'style',
47 'admin_label' => true,
48 'dependency' => '',
49 'weight' => '',
50 'group' => '' ,
51 'edit_field_class' => '',
52 'choices' => array(
53 'aux-highlight-red' => array(
54 'label' => __('Red', 'auxin-elements' ),
55 'css_class' => 'axiAdminIcon-none',
56 'image' => ''
57 ),
58 'aux-highlight-blue' => array(
59 'label' => __('Blue', 'auxin-elements' ),
60 'css_class' => 'axiAdminIcon-repeat-y',
61 'image' => ''
62 ),
63 'aux-highlight-yellow' => array(
64 'label' => __('Yellow', 'auxin-elements' ),
65 'css_class' => 'axiAdminIcon-repeat-x',
66 'image' => ''
67 ),
68 'aux-highlight-green' => array(
69 'label' => __('Green', 'auxin-elements' ),
70 'css_class' => 'axiAdminIcon-repeat-y',
71 'image' => ''
72 )
73 )
74 ),
75 array(
76 'heading' => __('Content','auxin-elements' ),
77 'description' => __('Enter the text to be highlighted.', 'auxin-elements' ),
78 'param_name' => 'content',
79 'type' => 'textarea_html',
80 'value' => '',
81 'def_value' => '',
82 'holder' => 'div',
83 'class' => 'content',
84 'admin_label' => true,
85 'dependency' => '',
86 'weight' => '',
87 'group' => '' ,
88 'edit_field_class' => ''
89 ),
90
91 array(
92 'heading' => __('Extra class name','auxin-elements' ),
93 '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' ),
94 'param_name' => 'extra_classes',
95 'type' => 'textfield',
96 'value' => '',
97 'def_value' => '',
98 'holder' => 'textfield',
99 'class' => 'extra_classes',
100 'admin_label' => true,
101 'dependency' => '',
102 'weight' => '',
103 'group' => '' ,
104 'edit_field_class' => ''
105 )
106 )
107 );
108
109 return $master_array;
110 }
111
112 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_highlight_master_array', 10, 1 );
113
114
115
116 /**
117 * The front-end output of this element is returned by the following function
118 *
119 * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
120 * @param string $shortcode_content The shorcode content
121 * @return string The output of element markup
122 */
123 function auxin_widget_highlight_callback( $atts, $shortcode_content = null ){
124
125 // Defining default attributes
126 $default_atts = array(
127 'title' => '', // header title
128 'content' => '', // header title
129 'style' => 'aux-highlight-red',
130
131 'extra_classes' => '', // custom css class names for this element
132 'custom_el_id' => '', // custom id attribute for this element
133 'base_class' => 'auxin-widget-highlight' // base class name for container
134 );
135
136 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
137 extract( $result['parsed_atts'] );
138
139 ob_start();
140
141 if( ! empty( $extra_classes ) ) {
142 $style .= " $extra_classes";
143 }
144
145 echo '<span class="aux-highlight ' . esc_attr( $style ) . '">' . esc_html( $content ) . '</span>';
146
147 return ob_get_clean();
148 }
149