PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.3.6
Strong Testimonials v3.3.6
3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / includes / class-walker-strong-category-checklist-front.php
strong-testimonials / includes Last commit date
elementor 1 year ago logs 2 months ago strong-testimonials-beaver-block 1 year ago submodules 9 months ago class-strong-gutemberg.php 1 year ago class-strong-log.php 1 year ago class-strong-mail.php 1 year ago class-strong-testimonials-average-shortcode.php 1 year ago class-strong-testimonials-count-shortcode.php 1 year ago class-strong-testimonials-defaults.php 3 weeks ago class-strong-testimonials-form.php 2 months ago class-strong-testimonials-order.php 1 year ago class-strong-testimonials-privacy.php 1 year ago class-strong-testimonials-render.php 2 months ago class-strong-testimonials-templates.php 3 weeks ago class-strong-testimonials-view-shortcode.php 1 month ago class-strong-testimonials-view-widget.php 1 year ago class-strong-view-display.php 1 week ago class-strong-view-form.php 3 weeks ago class-strong-view-slideshow.php 1 month ago class-strong-view.php 1 month ago class-walker-strong-category-checklist-front.php 1 year ago deprecated.php 1 year ago filters.php 2 months ago functions-activation.php 3 weeks ago functions-content.php 1 year ago functions-image.php 7 months ago functions-rating.php 1 year ago functions-template-form.php 3 weeks ago functions-template.php 3 weeks ago functions-views.php 1 year ago functions.php 2 weeks ago l10n-polylang.php 1 year ago l10n-wpml.php 1 year ago post-types.php 1 week ago retro.php 1 year ago scripts.php 2 months ago
class-walker-strong-category-checklist-front.php
129 lines
1 <?php
2 /**
3 * Taxonomy API: Walker_Strong_Category_Checklist_Front class
4 *
5 * @since 2.17.0
6 */
7
8 /**
9 * Custom walker class to output an unordered list of category checkbox input elements.
10 *
11 * @since 2.5.1
12 *
13 * @see Walker
14 * @see wp_category_checklist()
15 * @see wp_terms_checklist()
16 */
17 class Walker_Strong_Category_Checklist_Front extends Walker {
18 public $tree_type = 'category';
19 public $db_fields = array(
20 'parent' => 'parent',
21 'id' => 'term_id',
22 );
23
24 /**
25 * Starts the list before the elements are added.
26 *
27 * @see Walker:start_lvl()
28 *
29 * @since 2.5.1
30 *
31 * @param string $output Passed by reference. Used to append additional content.
32 * @param int $depth Depth of category. Used for tab indentation.
33 * @param array $args An array of arguments. @see wp_terms_checklist()
34 */
35 public function start_lvl( &$output, $depth = 0, $args = array() ) {
36 $indent = str_repeat( "\t", $depth );
37 $output .= "$indent<ul class='children'>\n";
38 }
39
40 /**
41 * Ends the list of after the elements are added.
42 *
43 * @see Walker::end_lvl()
44 *
45 * @since 2.5.1
46 *
47 * @param string $output Passed by reference. Used to append additional content.
48 * @param int $depth Depth of category. Used for tab indentation.
49 * @param array $args An array of arguments. @see wp_terms_checklist()
50 */
51 public function end_lvl( &$output, $depth = 0, $args = array() ) {
52 $indent = str_repeat( "\t", $depth );
53 $output .= "$indent</ul>\n";
54 }
55
56 /**
57 * Start the element output.
58 *
59 * @see Walker::start_el()
60 *
61 * @since 2.5.1
62 *
63 * @param string $output Passed by reference. Used to append additional content.
64 * @param object $category The current term object.
65 * @param int $depth Depth of the term in reference to parents. Default 0.
66 * @param array $args An array of arguments. @see wp_terms_checklist()
67 * @param int $id ID of the current term.
68 */
69 public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
70 if ( empty( $args['taxonomy'] ) ) {
71 $taxonomy = 'wpm-testimonial-category';
72 } else {
73 $taxonomy = $args['taxonomy'];
74 }
75
76 $name = 'category';
77
78 $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
79 $class = in_array( $category->term_id, $args['popular_cats'], true ) ? ' class="popular-category"' : '';
80
81 $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
82
83 $args['cat_counts'] = empty( $args['cat_counts'] ) ? array() : $args['cat_counts'];
84
85 if ( ! empty( $args['list_only'] ) ) {
86 $aria_cheched = 'false';
87 $inner_class = 'category';
88
89 if ( in_array( $category->term_id, $args['selected_cats'], true ) ) {
90 $inner_class .= ' selected';
91 $aria_cheched = 'true';
92 }
93
94 /** This filter is documented in wp-includes/category-template.php */
95 $output .= "\n" . '<li' . $class . '>' .
96 '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
97 ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' .
98 esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
99 } else {
100 /** This filter is documented in wp-includes/category-template.php */
101 // newlines make for consistent spacing without extra CSS
102 $output .= "\n" . '<li id="li-category-' . $category->term_id . '"' . $class . '>' . "\n";
103 $output .= '<input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]"'
104 . ' id="category-' . $category->term_id . '"'
105 . checked( in_array( $category->term_id, $args['selected_cats'], true ), true, false )
106 . disabled( empty( $args['disabled'] ), false, false ) . ' />' . "\n";
107 $output .= '<label class="selectit" for="category-' . $category->term_id . '">' . "\n";
108 $output .= esc_html( apply_filters( 'the_category', $category->name ) );
109 $output .= '</label>';
110 }
111 }
112
113 /**
114 * Ends the element output, if needed.
115 *
116 * @see Walker::end_el()
117 *
118 * @since 2.5.1
119 *
120 * @param string $output Passed by reference. Used to append additional content.
121 * @param object $category The current term object.
122 * @param int $depth Depth of the term in reference to parents. Default 0.
123 * @param array $args An array of arguments. @see wp_terms_checklist()
124 */
125 public function end_el( &$output, $category, $depth = 0, $args = array() ) {
126 $output .= "</li>\n";
127 }
128 }
129