PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.3.2
Strong Testimonials v3.3.2
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 / admin / class-walker-strong-category-checklist.php
strong-testimonials / admin Last commit date
challenge 1 year ago css 1 week ago img 1 year ago js 1 month ago menu 1 month ago partials 2 weeks ago rest-api 1 week ago scss 1 year ago settings 1 week ago uninstall 1 year ago wpchill 1 month ago admin-notices.php 6 months ago admin.php 1 month ago class-strong-testimonials-addons.php 1 month ago class-strong-testimonials-admin-category-list.php 1 year ago class-strong-testimonials-admin-list.php 1 year ago class-strong-testimonials-admin-scripts.php 1 month ago class-strong-testimonials-admin.php 1 month ago class-strong-testimonials-debug.php 6 months ago class-strong-testimonials-exporter.php 1 year ago class-strong-testimonials-help.php 1 year ago class-strong-testimonials-helper.php 1 month ago class-strong-testimonials-list-table.php 1 year ago class-strong-testimonials-lite-vs-pro-page.php 1 month ago class-strong-testimonials-post-editor.php 7 months ago class-strong-testimonials-review.php 1 year ago class-strong-testimonials-updater.php 1 month ago class-strong-testimonials-upsell.php 1 week ago class-strong-views-list-table.php 1 month ago class-walker-strong-category-checklist.php 1 year ago class-walker-strong-form-category-checklist.php 1 year ago class-wpmtst-onboarding.php 1 year ago compat.php 1 year ago custom-fields-ajax.php 1 year ago custom-fields.php 1 week ago form-preview.php 1 year ago view-list-order.php 1 year ago views-ajax.php 1 month ago views-validate.php 1 year ago views.php 1 month ago
class-walker-strong-category-checklist.php
130 lines
1 <?php
2 /**
3 * Taxonomy API: Walker_Strong_Category_Checklist class
4 *
5 * @since 2.2.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 extends Walker {
18 public $tree_type = 'category';
19 public $db_fields = array(
20 'parent' => 'parent',
21 'id' => 'term_id',
22 ); //TODO: decouple this
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 = 'view[data][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 . ' <span class="cat-count">(' . $category->count . ')</span>';
110 $output .= '</label>';
111 }
112 }
113
114 /**
115 * Ends the element output, if needed.
116 *
117 * @see Walker::end_el()
118 *
119 * @since 2.5.1
120 *
121 * @param string $output Passed by reference. Used to append additional content.
122 * @param object $category The current term object.
123 * @param int $depth Depth of the term in reference to parents. Default 0.
124 * @param array $args An array of arguments. @see wp_terms_checklist()
125 */
126 public function end_el( &$output, $category, $depth = 0, $args = array() ) {
127 $output .= "</li>\n";
128 }
129 }
130