|
@@ -1,5 +1,5 @@ discard block |
|
|
block discarded – undo |
|
1
|
1
|
<?php |
|
2
|
|
-if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
|
2
|
+if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3
|
3
|
exit('NO direct script access allowed'); |
|
4
|
4
|
|
|
5
|
5
|
/** |
|
@@ -31,7 +31,7 @@ discard block |
|
|
block discarded – undo |
|
31
|
31
|
|
|
32
|
32
|
class Event_Categories_Admin_List_Table extends EE_Admin_List_Table { |
|
33
|
33
|
|
|
34
|
|
- public function __construct( $admin_page ) { |
|
|
34
|
+ public function __construct($admin_page) { |
|
35
|
35
|
parent::__construct($admin_page); |
|
36
|
36
|
} |
|
37
|
37
|
|
|
@@ -39,8 +39,8 @@ discard block |
|
|
block discarded – undo |
|
39
|
39
|
|
|
40
|
40
|
|
|
41
|
41
|
protected function _setup_data() { |
|
42
|
|
- $this->_data = $this->_admin_page->get_categories( $this->_per_page, $this->_current_page); |
|
43
|
|
- $this->_all_data_count = EEM_Term_Taxonomy::instance()->count( array( array( 'taxonomy' => 'espresso_event_categories' ) ) ); |
|
|
42
|
+ $this->_data = $this->_admin_page->get_categories($this->_per_page, $this->_current_page); |
|
|
43
|
+ $this->_all_data_count = EEM_Term_Taxonomy::instance()->count(array(array('taxonomy' => 'espresso_event_categories'))); |
|
44
|
44
|
} |
|
45
|
45
|
|
|
46
|
46
|
|
|
@@ -49,8 +49,8 @@ discard block |
|
|
block discarded – undo |
|
49
|
49
|
|
|
50
|
50
|
protected function _set_properties() { |
|
51
|
51
|
$this->_wp_list_args = array( |
|
52
|
|
- 'singular' => __('event category', 'event_espresso' ), |
|
53
|
|
- 'plural' => __('event categories', 'event_espresso' ), |
|
|
52
|
+ 'singular' => __('event category', 'event_espresso'), |
|
|
53
|
+ 'plural' => __('event categories', 'event_espresso'), |
|
54
|
54
|
'ajax' => TRUE, //for now, |
|
55
|
55
|
'screen' => $this->_admin_page->get_current_screen()->id |
|
56
|
56
|
); |
|
@@ -64,9 +64,9 @@ discard block |
|
|
block discarded – undo |
|
64
|
64
|
); |
|
65
|
65
|
|
|
66
|
66
|
$this->_sortable_columns = array( |
|
67
|
|
- 'id' => array( 'Term.term_id' => true ), |
|
68
|
|
- 'name' => array( 'Term.slug' => false ), |
|
69
|
|
- 'count' => array( 'term_count' => false ) |
|
|
67
|
+ 'id' => array('Term.term_id' => true), |
|
|
68
|
+ 'name' => array('Term.slug' => false), |
|
|
69
|
+ 'count' => array('term_count' => false) |
|
70
|
70
|
); |
|
71
|
71
|
|
|
72
|
72
|
$this->_primary_column = 'id'; |
|
@@ -98,7 +98,7 @@ discard block |
|
|
block discarded – undo |
|
98
|
98
|
|
|
99
|
99
|
|
|
100
|
100
|
public function column_cb($item) { |
|
101
|
|
- return sprintf( '<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id') ); |
|
|
101
|
+ return sprintf('<input type="checkbox" name="EVT_CAT_ID[]" value="%s" />', $item->get('term_id')); |
|
102
|
102
|
} |
|
103
|
103
|
|
|
104
|
104
|
|
|
@@ -107,7 +107,7 @@ discard block |
|
|
block discarded – undo |
|
107
|
107
|
|
|
108
|
108
|
public function column_id($item) { |
|
109
|
109
|
$content = $item->get('term_id'); |
|
110
|
|
- $content .= ' <span class="show-on-mobile-view-only">' . $item->get_first_related('Term')->get('name') . '</span>'; |
|
|
110
|
+ $content .= ' <span class="show-on-mobile-view-only">'.$item->get_first_related('Term')->get('name').'</span>'; |
|
111
|
111
|
return $content; |
|
112
|
112
|
} |
|
113
|
113
|
|
|
@@ -127,17 +127,17 @@ discard block |
|
|
block discarded – undo |
|
127
|
127
|
'EVT_CAT_ID' => $item->get('term_id') |
|
128
|
128
|
); |
|
129
|
129
|
|
|
130
|
|
- $edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EVENTS_ADMIN_URL ); |
|
131
|
|
- $delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EVENTS_ADMIN_URL ); |
|
|
130
|
+ $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL); |
|
|
131
|
+ $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EVENTS_ADMIN_URL); |
|
132
|
132
|
|
|
133
|
133
|
$actions = array( |
|
134
|
|
- 'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Category', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>' |
|
|
134
|
+ 'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Category', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>' |
|
135
|
135
|
); |
|
136
|
136
|
|
|
137
|
137
|
|
|
138
|
|
- $actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Category', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>'; |
|
|
138
|
+ $actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Category', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>'; |
|
139
|
139
|
|
|
140
|
|
- $content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->get_first_related('Term')->get('name') . '</a></strong>'; |
|
|
140
|
+ $content = '<strong><a class="row-title" href="'.$edit_link.'">'.$item->get_first_related('Term')->get('name').'</a></strong>'; |
|
141
|
141
|
$content .= $this->row_actions($actions); |
|
142
|
142
|
return $content; |
|
143
|
143
|
} |
|
@@ -146,20 +146,20 @@ discard block |
|
|
block discarded – undo |
|
146
|
146
|
|
|
147
|
147
|
|
|
148
|
148
|
public function column_shortcode($item) { |
|
149
|
|
- $content = '[ESPRESSO_EVENTS category_slug=' . $item->get_first_related('Term')->get('slug') . ']'; |
|
|
149
|
+ $content = '[ESPRESSO_EVENTS category_slug='.$item->get_first_related('Term')->get('slug').']'; |
|
150
|
150
|
return $content; |
|
151
|
151
|
} |
|
152
|
152
|
|
|
153
|
153
|
|
|
154
|
154
|
|
|
155
|
155
|
|
|
156
|
|
- public function column_count( $item ) { |
|
|
156
|
+ public function column_count($item) { |
|
157
|
157
|
$e_args = array( |
|
158
|
158
|
'action' => 'default', |
|
159
|
159
|
'EVT_CAT' => $item->get_first_related('Term')->ID() |
|
160
|
160
|
); |
|
161
|
|
- $e_link = EE_Admin_Page::add_query_args_and_nonce( $e_args, EVENTS_ADMIN_URL ); |
|
162
|
|
- $content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>'; |
|
|
161
|
+ $e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EVENTS_ADMIN_URL); |
|
|
162
|
+ $content = '<a href="'.$e_link.'">'.$item->get('term_count').'</a>'; |
|
163
|
163
|
return $content; |
|
164
|
164
|
} |
|
165
|
165
|
} |