PluginProbe
QuadMenu – Mega Menu / 2.0.4
QuadMenu – Mega Menu v2.0.4
3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 All 87 releases
quadmenu / includes / frontend / walker / QuadMenuItemPostType.class.php

QuadMenuItemPostType.class.php in QuadMenu – Mega Menu 2.0.4, at includes/frontend/walker/QuadMenuItemPostType.class.php

78 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) {
4 die('-1');
5 }
6
7 class QuadMenuItemPostType extends QuadMenuItem {
8
9 protected $type = 'post_type';
10
11 function init() {
12
13 if (0 < $this->depth) {
14
15 $this->args->has_thumbnail = (bool) ($this->item->thumb);
16
17 $this->args->has_subtitle = (bool) $this->args->has_subtitle;
18
19 $this->args->has_excerpt = (bool) ($this->item->excerpt == 'on');
20
21 if ($this->args->has_thumbnail) {
22 $this->args->has_badge = false;
23 }
24
25 if ($this->args->has_excerpt) {
26
27 $this->args->has_subtitle = false;
28
29 if (!$this->item->description) {
30
31 $post = get_post($this->item->object_id);
32
33 if (isset($post->post_excerpt)) {
34 $this->item->description = wp_trim_words(wpautop($this->clean_item_content($post->post_excerpt ? $post->post_excerpt : $post->post_content)), 10);
35 $this->args->has_description = true;
36 } else {
37 $this->args->has_excerpt = false;
38 }
39 }
40 }
41 }
42 }
43
44 function get_start_el() {
45
46 $item_output = '';
47
48 $this->add_item_classes();
49
50 $this->add_item_classes_prefix();
51
52 $this->add_item_classes_current();
53
54 $this->add_item_classes_post_type();
55
56 $this->add_item_classes_quadmenu();
57
58 $id = $this->get_item_id();
59
60 $class = $this->get_item_classes();
61
62 $item_output .= '<li' . $id . $class . '>';
63
64 $this->add_link_atts();
65
66 $this->add_link_atts_toggle();
67
68 $item_output .= $this->get_link();
69
70 return $item_output;
71 }
72
73 function add_item_classes_post_type() {
74 $this->item_classes[] = 'quadmenu-item-type-post_type';
75 }
76
77 }
78