Admin Columns - Version 3.0.5

Version Description

Release Date: November 9th, 2017

  • [Added] Events Calendar integration add-on is now available from the add-ons tab
  • [Added] Added before/after fields for ID column
  • [Changed] Changed Ajax value interface
  • [Fixed] Fixed php warning on count() for php 7.2
  • [Improved] Column interface for post relations
  • [Improved] Attachment count column combined with Attachment column
  • [Improved] Pro banner
  • [Improved] Published date shows when a post is not published
  • [Improved] Custom field keys for users are now grouped by site option
  • [Improved] Added the AC_Plugin class as a more DRY approach to asking meta data about a plugin
  • [Improved] Redone the way user preferences are stored. Less records and better compatible with Multisite.
  • [Improved] Added the option to write database updates and apply them on a new version
  • [Improved] Empty character is just a method now instead of getter/setter with a filter
  • [Improved] Added AC_Services class to register services to a column on the fly (DI approach)
  • [Improved] Custom fields for users are now grouped per network site
Download this release

Release Info

Developer tschutter
Plugin Icon 128x128 Admin Columns
Version 3.0.5
Comparing to
See all releases

Code changes from version 3.0.3 to 3.0.5

Files changed (136) hide show
  1. api.php +0 -9
  2. assets/css/table.css +173 -13
  3. assets/css/table.min.css +1 -1
  4. assets/images/addons/events-calendar-icon.png +0 -0
  5. assets/images/addons/events-calendar.png +0 -0
  6. assets/images/addons/ninja-forms-icon.png +0 -0
  7. assets/images/addons/ninja-forms.png +0 -0
  8. assets/js/admin-page-columns.js +13 -6
  9. assets/js/admin-page-columns.min.js +1 -1
  10. assets/js/table.js +20 -1
  11. assets/js/table.min.js +1 -1
  12. classes/API.php +24 -11
  13. classes/Addon/BuddyPress.php +1 -1
  14. classes/Addon/EventsCalendar.php +38 -0
  15. classes/Addon/NinjaForms.php +38 -0
  16. classes/Addon/Pods.php +1 -1
  17. classes/Addon/Types.php +1 -1
  18. classes/Admin/Page/Addons.php +42 -42
  19. classes/Admin/Page/Columns.php +22 -22
  20. classes/Collection.php +21 -0
  21. classes/Column.php +22 -19
  22. classes/Column/ActionColumnHelper.php +0 -78
  23. classes/Column/Actions.php +1 -12
  24. classes/Column/Comment/Actions.php +0 -16
  25. classes/Column/Comment/DateGmt.php +1 -1
  26. classes/Column/Comment/WordCount.php +1 -1
  27. classes/Column/Link/Actions.php +1 -1
  28. classes/Column/Media/Actions.php +0 -16
  29. classes/Column/Media/AlternateText.php +1 -1
  30. classes/Column/Media/AttachedTo.php +0 -31
  31. classes/Column/Media/AvailableSizes.php +44 -35
  32. classes/Column/Media/Dimensions.php +10 -13
  33. classes/Column/Media/ExifData.php +3 -5
  34. classes/Column/Media/Height.php +9 -7
  35. classes/Column/Media/ID.php +1 -1
  36. classes/Column/Media/MetaValue.php +26 -0
  37. classes/Column/Media/Width.php +3 -11
  38. classes/Column/{UsedByMenu.php → Menu.php} +51 -7
  39. classes/Column/Meta.php +3 -3
  40. classes/Column/Post/Actions.php +0 -16
  41. classes/Column/Post/Attachment.php +1 -1
  42. classes/Column/Post/AttachmentCount.php +0 -31
  43. classes/Column/Post/BeforeMoreTag.php +1 -1
  44. classes/Column/Post/CommentStatus.php +1 -1
  45. classes/Column/Post/DatePublished.php +25 -1
  46. classes/Column/Post/Formats.php +5 -9
  47. classes/Column/Post/ID.php +5 -1
  48. classes/Column/Post/Roles.php +9 -9
  49. classes/Column/Post/TitleRaw.php +5 -5
  50. classes/Column/RelationInterface.php +16 -0
  51. classes/Column/Taxonomy.php +3 -1
  52. classes/Column/User/Actions.php +0 -16
  53. classes/Column/User/ShowToolbar.php +2 -2
  54. classes/Container.php +55 -0
  55. classes/Helper.php +11 -10
  56. classes/Helper/Array.php +13 -0
  57. classes/Helper/Date.php +12 -0
  58. classes/Helper/File.php +22 -2
  59. classes/Helper/Html.php +65 -10
  60. classes/Helper/Icon.php +4 -4
  61. classes/Helper/Image.php +81 -2
  62. classes/Helper/Media.php +94 -0
  63. classes/Helper/Post.php +34 -0
  64. classes/Helper/String.php +5 -3
  65. classes/Helper/User.php +68 -36
  66. classes/ListScreen.php +34 -6
  67. classes/ListScreen/Comment.php +3 -2
  68. classes/ListScreen/Media.php +3 -2
  69. classes/ListScreen/Post.php +3 -10
  70. classes/ListScreen/User.php +3 -2
  71. classes/Meta/Query.php +1 -1
  72. classes/Notice/Review.php +43 -42
  73. classes/Plugin.php +152 -0
  74. classes/Plugin/Update.php +64 -0
  75. classes/Plugin/Update/V305.php +132 -0
  76. classes/Plugin/Updater.php +95 -0
  77. classes/Preferences.php +139 -0
  78. classes/Relation.php +38 -0
  79. classes/Relation/Post.php +36 -0
  80. classes/Relation/Taxonomy.php +36 -0
  81. classes/Settings/Column/AttachmentDisplay.php +73 -0
  82. classes/Settings/Column/BeforeAfter.php +20 -2
  83. classes/Settings/Column/BeforeAfter/Aperture.php +13 -0
  84. classes/Settings/Column/BeforeAfter/FocalLength.php +13 -0
  85. classes/Settings/Column/BeforeAfter/ISO.php +13 -0
  86. classes/Settings/Column/BeforeAfter/ShutterSpeed.php +13 -0
  87. classes/Settings/Column/CommentCount.php +24 -6
  88. classes/Settings/Column/CustomField.php +7 -26
  89. classes/Settings/Column/CustomFieldType.php +8 -3
  90. classes/Settings/Column/Date.php +5 -3
  91. classes/Settings/Column/ExifData.php +42 -5
  92. classes/Settings/Column/Image.php +1 -1
  93. classes/Settings/Column/Images.php +24 -0
  94. classes/Settings/Column/LinkToMenu.php +1 -1
  95. classes/Settings/Column/Meta.php +87 -22
  96. classes/Settings/Column/MissingImageSize.php +52 -0
  97. classes/Settings/Column/NumberOfItems.php +57 -0
  98. classes/Settings/Column/Post.php +10 -7
  99. classes/Settings/Column/PostFormatIcon.php +83 -0
  100. classes/Settings/Column/PostLink.php +17 -4
  101. classes/Settings/Column/StatusIcon.php +5 -24
  102. classes/Settings/Column/StringLimit.php +77 -0
  103. classes/Settings/Column/Taxonomy.php +2 -1
  104. classes/Settings/Column/User.php +4 -3
  105. classes/Settings/Form/Element/Checkbox.php +24 -2
  106. classes/TableScreen.php +22 -3
  107. codepress-admin-columns.php +63 -65
  108. languages/codepress-admin-columns-ar_AR.po +106 -63
  109. languages/codepress-admin-columns-bt_BR.po +106 -63
  110. languages/codepress-admin-columns-da_DK.po +106 -63
  111. languages/codepress-admin-columns-de_DE.mo +0 -0
  112. languages/codepress-admin-columns-de_DE.po +140 -97
  113. languages/codepress-admin-columns-en_NZ.po +106 -63
  114. languages/codepress-admin-columns-es_ES.po +106 -63
  115. languages/codepress-admin-columns-fa_IR.po +106 -63
  116. languages/codepress-admin-columns-fr_FR.mo +0 -0
  117. languages/codepress-admin-columns-fr_FR.po +108 -65
  118. languages/codepress-admin-columns-he_IL.mo +0 -0
  119. languages/codepress-admin-columns-he_IL.po +106 -63
  120. languages/codepress-admin-columns-hu_HU.po +106 -63
  121. languages/codepress-admin-columns-it_IT.mo +0 -0
  122. languages/codepress-admin-columns-it_IT.po +120 -75
  123. languages/codepress-admin-columns-ja_JA.mo +0 -0
  124. languages/codepress-admin-columns-ja_JA.po +106 -63
  125. languages/codepress-admin-columns-nl_NL.mo +0 -0
  126. languages/codepress-admin-columns-nl_NL.po +106 -63
  127. languages/codepress-admin-columns-pl_PL.po +106 -63
  128. languages/codepress-admin-columns-ro_RO.mo +0 -0
  129. languages/codepress-admin-columns-ro_RO.po +109 -66
  130. languages/codepress-admin-columns-ru_RU.mo +0 -0
  131. languages/codepress-admin-columns-ru_RU.po +397 -354
  132. languages/codepress-admin-columns-sv_SE.mo +0 -0
  133. languages/codepress-admin-columns-sv_SE.po +123 -80
  134. languages/codepress-admin-columns-zh_CN.po +106 -63
  135. languages/codepress-admin-columns.pot +241 -113
  136. readme.txt +45 -2
api.php CHANGED
@@ -87,15 +87,6 @@ function ac_is_version_gte( $version ) {
87
return version_compare( AC()->get_version(), $version, '>=' );
88
}
89
90
- /**
91
- * Returns row actions for the WP_List_Tables
92
- *
93
- * @return AC_Column_ActionColumnHelper
94
- */
95
- function ac_action_column_helper() {
96
- return AC_Column_ActionColumnHelper::instance();
97
- }
98
-
99
/**
100
* Manually set the columns for a list screen
101
* This overrides the database settings and thus renders the settings screen for this list screen useless
87
return version_compare( AC()->get_version(), $version, '>=' );
88
}
89
90
/**
91
* Manually set the columns for a list screen
92
* This overrides the database settings and thus renders the settings screen for this list screen useless
assets/css/table.css CHANGED
@@ -1,3 +1,29 @@
1
/* =Status icons
2
-------------------------------------------------------------- */
3
.column-status .dashicons {
@@ -10,6 +36,74 @@
10
font-size: 15px;
11
margin-left: -2px; }
12
13
/* =General
14
-------------------------------------------------------------- */
15
.ac-divider {
@@ -35,13 +129,13 @@ span.status-closed {
35
vertical-align: middle;
36
margin-bottom: 4px; }
37
38
- .tablenav.top .cpac-edit {
39
top: 2px;
40
display: inline-block;
41
vertical-align: middle;
42
float: left;
43
margin-bottom: 4px; }
44
- body.edit-tags-php .tablenav.top .cpac-edit {
45
float: none; }
46
47
span.dashicons.flip:before {
@@ -87,10 +181,10 @@ body.users-php .tablenav .actions a.add-new-h2 {
87
margin-bottom: 4px; }
88
.tablenav.top .actions * {
89
display: none; }
90
- .tablenav.top .actions .cpac-edit {
91
display: inline-block; } }
92
93
- body.upload-php .tablenav.top .cpac-edit {
94
float: none; }
95
96
/* =Column values
@@ -124,6 +218,58 @@ table.ac-table-items {
124
padding-right: 6px;
125
text-align: left; }
126
127
/* =Storage Space column
128
-------------------------------------------------------------- */
129
.ac-upload-space .ac-upload-space-labels {
@@ -187,7 +333,7 @@ table.ac-table-items {
187
188
/* =Network screen
189
-------------------------------------------------------------- */
190
- #form-site-list .tablenav .actions .cpac-edit {
191
float: none; }
192
193
/* =General Column
@@ -245,12 +391,17 @@ table.ac-table-items {
245
246
/* =Images Column
247
-------------------------------------------------------------- */
248
.ac-image {
249
display: inline-block;
250
margin-right: 2px;
251
overflow: hidden;
252
max-width: 100%;
253
- background-color: #ccc; }
254
.ac-image img {
255
display: block;
256
margin: 0 auto; }
@@ -345,11 +496,6 @@ div.cpac-color span {
345
margin-left: 12px;
346
margin-right: 0; }
347
348
- /* =Available Sizes column
349
- -------------------------------------------------------------- */
350
- div.sizes span.not-available {
351
- color: #999; }
352
-
353
/* =Actions column
354
-------------------------------------------------------------- */
355
.button.cpac-button-action {
@@ -410,9 +556,9 @@ div.sizes span.not-available {
410
left: 0;
411
width: 100%;
412
height: 100%; }
413
- .column-actions.cpac_use_icons .row-actions > span.edit a, .column-actions.cpac_use_icons .row-actions > span.inline a, .column-actions.cpac_use_icons .row-actions > span.trash a, .column-actions.cpac_use_icons .row-actions > span.view a, .column-actions.cpac_use_icons .row-actions > span.quickedit a, .column-actions.cpac_use_icons .row-actions > span.approve a, .column-actions.cpac_use_icons .row-actions > span.unapprove a, .column-actions.cpac_use_icons .row-actions > span.spam a, .column-actions.cpac_use_icons .row-actions > span.untrash a, .column-actions.cpac_use_icons .row-actions > span.unspam a, .column-actions.cpac_use_icons .row-actions > span.reply a, .column-actions.cpac_use_icons .row-actions > span.delete a {
414
text-indent: -3000px; }
415
- .column-actions.cpac_use_icons .row-actions > span.edit a:before, .column-actions.cpac_use_icons .row-actions > span.inline a:before, .column-actions.cpac_use_icons .row-actions > span.trash a:before, .column-actions.cpac_use_icons .row-actions > span.view a:before, .column-actions.cpac_use_icons .row-actions > span.quickedit a:before, .column-actions.cpac_use_icons .row-actions > span.approve a:before, .column-actions.cpac_use_icons .row-actions > span.unapprove a:before, .column-actions.cpac_use_icons .row-actions > span.spam a:before, .column-actions.cpac_use_icons .row-actions > span.untrash a:before, .column-actions.cpac_use_icons .row-actions > span.unspam a:before, .column-actions.cpac_use_icons .row-actions > span.reply a:before, .column-actions.cpac_use_icons .row-actions > span.delete a:before {
416
text-indent: 0;
417
font-family: Dashicons, sans-serif; }
418
.column-actions.cpac_use_icons .row-actions > span.edit a:before {
@@ -440,6 +586,20 @@ div.sizes span.not-available {
440
content: "\f171"; }
441
.column-actions.cpac_use_icons .row-actions > span.delete a:before {
442
content: "\f182"; }
443
444
/* Responsive table screen
445
-------------------------------------------------------------- */
1
+ @charset "UTF-8";
2
+ @font-face {
3
+ font-family: "cpac_icons";
4
+ src: url("../fonts/cpac_icons.woff") format("woff"); }
5
+
6
+ [class^="cpacicon-"], [class*=" cpacicon-"] {
7
+ font-family: 'cpac_icons';
8
+ speak: none;
9
+ font-style: normal;
10
+ font-weight: normal;
11
+ font-variant: normal;
12
+ text-transform: none;
13
+ line-height: 1;
14
+ /* Better Font Rendering =========== */
15
+ -webkit-font-smoothing: antialiased;
16
+ -moz-osx-font-smoothing: grayscale; }
17
+ [class^="cpacicon-"]:before, [class*=" cpacicon-"]:before {
18
+ font-size: 100%; }
19
+
20
+ .cpacicon-draft:before {
21
+ content: ""; }
22
+
23
+ .cpacicon-move:before {
24
+ content: ""; }
25
+
26
+ /* Dynamic variables */
27
/* =Status icons
28
-------------------------------------------------------------- */
29
.column-status .dashicons {
36
font-size: 15px;
37
margin-left: -2px; }
38
39
+ /* =Available Sizes column
40
+ -------------------------------------------------------------- */
41
+ .ac-image-sizes .ac-missing-size {
42
+ color: #929292; }
43
+
44
+ /* =Comments bubble
45
+ -------------------------------------------------------------- */
46
+ .ac-comment-bubble .post-com-count {
47
+ display: inline-block;
48
+ vertical-align: top; }
49
+
50
+ .ac-comment-bubble .post-com-count-no-comments,
51
+ .ac-comment-bubble .post-com-count-approved {
52
+ margin-top: 5px; }
53
+
54
+ .ac-comment-bubble .comment-count-no-comments,
55
+ .ac-comment-bubble .comment-count-approved {
56
+ -webkit-box-sizing: border-box;
57
+ -moz-box-sizing: border-box;
58
+ box-sizing: border-box;
59
+ display: block;
60
+ padding: 0 8px;
61
+ min-width: 24px;
62
+ height: 2em;
63
+ -webkit-border-radius: 5px;
64
+ border-radius: 5px;
65
+ background-color: #72777c;
66
+ color: #fff;
67
+ font-size: 11px;
68
+ line-height: 21px;
69
+ text-align: center; }
70
+
71
+ .ac-comment-bubble .post-com-count-no-comments:after,
72
+ .ac-comment-bubble .post-com-count-approved:after {
73
+ content: "";
74
+ display: block;
75
+ margin-left: 8px;
76
+ width: 0;
77
+ height: 0;
78
+ border-top: 5px solid #72777c;
79
+ border-right: 5px solid transparent; }
80
+
81
+ .ac-comment-bubble .post-com-count-approved:hover .comment-count-approved,
82
+ .ac-comment-bubble .post-com-count-approved:focus .comment-count-approved {
83
+ background: #0073aa; }
84
+
85
+ .ac-comment-bubble .post-com-count-approved:hover:after,
86
+ .ac-comment-bubble .post-com-count-approved:focus:after {
87
+ border-top-color: #0073aa; }
88
+
89
+ .ac-comment-bubble .post-com-count-pending {
90
+ position: relative;
91
+ left: -3px;
92
+ padding: 0 5px;
93
+ min-width: 7px;
94
+ height: 17px;
95
+ border: 2px solid #fff;
96
+ -webkit-border-radius: 11px;
97
+ border-radius: 11px;
98
+ background: #ca4a1f;
99
+ color: #fff;
100
+ font-size: 9px;
101
+ line-height: 17px;
102
+ text-align: center; }
103
+
104
+ .ac-comment-bubble .post-com-count-no-pending {
105
+ display: none; }
106
+
107
/* =General
108
-------------------------------------------------------------- */
109
.ac-divider {
129
vertical-align: middle;
130
margin-bottom: 4px; }
131
132
+ .tablenav.top .ac-button {
133
top: 2px;
134
display: inline-block;
135
vertical-align: middle;
136
float: left;
137
margin-bottom: 4px; }
138
+ body.edit-tags-php .tablenav.top .ac-button {
139
float: none; }
140
141
span.dashicons.flip:before {
181
margin-bottom: 4px; }
182
.tablenav.top .actions * {
183
display: none; }
184
+ .tablenav.top .actions .ac-button {
185
display: inline-block; } }
186
187
+ body.upload-php .tablenav.top .ac-button {
188
float: none; }
189
190
/* =Column values
218
padding-right: 6px;
219
text-align: left; }
220
221
+ /* =Post Format column
222
+ -------------------------------------------------------------- */
223
+ .ac-post-state-format:before {
224
+ color: #a7a7a7; }
225
+
226
+ /* =Image in Content column
227
+ -------------------------------------------------------------- */
228
+ .ac-image-details .ac-image-info {
229
+ display: inline-block;
230
+ border-radius: 7px;
231
+ padding: 0 9px;
232
+ min-height: 20px;
233
+ background-color: #e9e9e9;
234
+ text-align: left;
235
+ font-size: 11px;
236
+ font-weight: bold;
237
+ margin: 0 6px 5px 0;
238
+ white-space: nowrap; }
239
+ .ac-image-details .ac-image-info > span {
240
+ margin-right: 6px; }
241
+ .ac-image-details .ac-image-info > span:last-child {
242
+ margin-right: 0; }
243
+ .ac-image-details .ac-image-info span {
244
+ vertical-align: middle;
245
+ line-height: 20px; }
246
+ .ac-image-details .ac-image-info span.image-id {
247
+ font-size: 11px;
248
+ color: #757575; }
249
+ .ac-image-details .ac-image-info span.image-file-size {
250
+ font-size: 12px; }
251
+ .ac-image-details .ac-image-info span.image-extension {
252
+ text-transform: uppercase;
253
+ font-size: 11px;
254
+ color: #757575; }
255
+ .ac-image-details .ac-image-info span.suffix {
256
+ display: inline-block;
257
+ text-transform: uppercase;
258
+ font-size: 10px;
259
+ color: #757575;
260
+ padding-left: 3px;
261
+ margin-top: -2px; }
262
+ .ac-image-details .ac-image-info span.dashicons {
263
+ margin-top: -2px;
264
+ color: #757575;
265
+ font-size: 14px;
266
+ width: 16px; }
267
+
268
+ .ac-image-details a.ac-image-info:hover {
269
+ color: #0073aa; }
270
+ .ac-image-details a.ac-image-info:hover span.dashicons {
271
+ color: #3d4350; }
272
+
273
/* =Storage Space column
274
-------------------------------------------------------------- */
275
.ac-upload-space .ac-upload-space-labels {
333
334
/* =Network screen
335
-------------------------------------------------------------- */
336
+ #form-site-list .tablenav .actions .ac-button {
337
float: none; }
338
339
/* =General Column
391
392
/* =Images Column
393
-------------------------------------------------------------- */
394
+ .ac-image-container {
395
+ margin-bottom: -6px; }
396
+
397
.ac-image {
398
display: inline-block;
399
margin-right: 2px;
400
+ margin-bottom: 6px;
401
overflow: hidden;
402
max-width: 100%;
403
+ background-color: #ccc;
404
+ vertical-align: middle; }
405
.ac-image img {
406
display: block;
407
margin: 0 auto; }
496
margin-left: 12px;
497
margin-right: 0; }
498
499
/* =Actions column
500
-------------------------------------------------------------- */
501
.button.cpac-button-action {
556
left: 0;
557
width: 100%;
558
height: 100%; }
559
+ .column-actions.cpac_use_icons .row-actions > span.edit a, .column-actions.cpac_use_icons .row-actions > span.inline a, .column-actions.cpac_use_icons .row-actions > span.trash a, .column-actions.cpac_use_icons .row-actions > span.view a, .column-actions.cpac_use_icons .row-actions > span.quickedit a, .column-actions.cpac_use_icons .row-actions > span.approve a, .column-actions.cpac_use_icons .row-actions > span.unapprove a, .column-actions.cpac_use_icons .row-actions > span.spam a, .column-actions.cpac_use_icons .row-actions > span.untrash a, .column-actions.cpac_use_icons .row-actions > span.unspam a, .column-actions.cpac_use_icons .row-actions > span.reply a, .column-actions.cpac_use_icons .row-actions > span.delete a, .column-actions.cpac_use_icons .row-actions > span.backend a, .column-actions.cpac_use_icons .row-actions > span.visit a, .column-actions.cpac_use_icons .row-actions > span.deactivate a, .column-actions.cpac_use_icons .row-actions > span.archive a, .column-actions.cpac_use_icons .row-actions > span.unarchive a, .column-actions.cpac_use_icons .row-actions > span.activate a, .column-actions.cpac_use_icons .row-actions > span.download a {
560
text-indent: -3000px; }
561
+ .column-actions.cpac_use_icons .row-actions > span.edit a:before, .column-actions.cpac_use_icons .row-actions > span.inline a:before, .column-actions.cpac_use_icons .row-actions > span.trash a:before, .column-actions.cpac_use_icons .row-actions > span.view a:before, .column-actions.cpac_use_icons .row-actions > span.quickedit a:before, .column-actions.cpac_use_icons .row-actions > span.approve a:before, .column-actions.cpac_use_icons .row-actions > span.unapprove a:before, .column-actions.cpac_use_icons .row-actions > span.spam a:before, .column-actions.cpac_use_icons .row-actions > span.untrash a:before, .column-actions.cpac_use_icons .row-actions > span.unspam a:before, .column-actions.cpac_use_icons .row-actions > span.reply a:before, .column-actions.cpac_use_icons .row-actions > span.delete a:before, .column-actions.cpac_use_icons .row-actions > span.backend a:before, .column-actions.cpac_use_icons .row-actions > span.visit a:before, .column-actions.cpac_use_icons .row-actions > span.deactivate a:before, .column-actions.cpac_use_icons .row-actions > span.archive a:before, .column-actions.cpac_use_icons .row-actions > span.unarchive a:before, .column-actions.cpac_use_icons .row-actions > span.activate a:before, .column-actions.cpac_use_icons .row-actions > span.download a:before {
562
text-indent: 0;
563
font-family: Dashicons, sans-serif; }
564
.column-actions.cpac_use_icons .row-actions > span.edit a:before {
586
content: "\f171"; }
587
.column-actions.cpac_use_icons .row-actions > span.delete a:before {
588
content: "\f182"; }
589
+ .column-actions.cpac_use_icons .row-actions > span.backend a:before {
590
+ content: "\f226"; }
591
+ .column-actions.cpac_use_icons .row-actions > span.visit a:before {
592
+ content: "\f115"; }
593
+ .column-actions.cpac_use_icons .row-actions > span.deactivate a:before {
594
+ content: "\f530"; }
595
+ .column-actions.cpac_use_icons .row-actions > span.archive a:before {
596
+ content: "\f480"; }
597
+ .column-actions.cpac_use_icons .row-actions > span.unarchive a:before {
598
+ content: "\f322"; }
599
+ .column-actions.cpac_use_icons .row-actions > span.activate a:before {
600
+ content: "\f177"; }
601
+ .column-actions.cpac_use_icons .row-actions > span.download a:before {
602
+ content: "\f316"; }
603
604
/* Responsive table screen
605
-------------------------------------------------------------- */
assets/css/table.min.css CHANGED
@@ -1 +1 @@
1
- .column-status .dashicons{font-size:22px}.column-status .dashicons.large{width:25px;height:28px;font-size:28px}.column-status .dashicons.dashicons-lock{font-size:15px;margin-left:-2px}.ac-divider{display:inline-block;width:14px;height:12px;background:transparent url(../images/square.png) no-repeat 50% 7px}span.status-closed{color:red}.ac-value-stars{white-space:nowrap;word-wrap:normal;display:block}.ac-value-stars .ac-value-star{font-size:16px;width:auto;margin-right:-3px}.actions #post-query-submit,.tablenav.top .cpac-edit{float:left;vertical-align:middle;margin-bottom:4px}.tablenav.top .cpac-edit{top:2px;display:inline-block}body.edit-tags-php .tablenav.top .cpac-edit{float:none}span.dashicons.flip:before{transform:scaleX(-1);display:inline-block}span.dashicons.yellow{color:#ffb900}span.dashicons.orange{color:#d54e21}span.dashicons.red{color:#dc3232}span.dashicons.green{color:#46b450}span.dashicons.light-gray{color:#bbb}span.dashicons.gray{color:#8a8a8a}span.dashicons.blue{color:#0073aa}span.dashicons.light-blue{color:#00a0d2}body.edit-php #delete_all{float:left;margin-right:3px}body.users-php .tablenav .actions a.add-new-h2{float:none;vertical-align:middle!important;top:2px!important}@media screen and (max-width:782px){.tablenav.top .actions{display:block!important;margin-bottom:4px}.tablenav.top .actions *{display:none}.tablenav.top .actions .cpac-edit{display:inline-block}}body.upload-php .tablenav.top .cpac-edit{float:none}.ac-toggle-box-link:focus{outline:none;box-shadow:none}.ac-toggle-box-link .spinner{float:none;margin-top:-2px}.ac-toggle-box-link.loading .spinner{visibility:visible}.ac-toggle-box-contents-ajax{padding:5px 0 0}.ac-toggle-box-contents{display:none;padding:5px 0 0}table.ac-table-items{border-spacing:0}table.ac-table-items tr td{border:0;margin:0;padding:0 0 3px}table.ac-table-items tr td.ac-table-item-qty{color:#999;padding-right:6px;text-align:left}.ac-upload-space .ac-upload-space-labels{display:table;width:100%}.ac-upload-space .ac-upload-space-labels .inner{display:table-row}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-icon{display:table-cell}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-icon:before{color:#82878c;content:"\f104";display:inline-block;font-family:dashicons,serif;width:20px;height:20px;font-size:18px;line-height:1;text-decoration:inherit;font-weight:400;font-style:normal;vertical-align:top;text-align:center;margin-right:4px}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-left{display:table-cell;white-space:nowrap}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-right{width:100%;text-align:right;padding-left:6px;display:table-cell;white-space:nowrap}.ac-upload-space .ac-upload-space-progress{margin-top:6px;height:3px;background:#fff;border:1px solid #dfdfdf;position:relative}.ac-upload-space .ac-upload-space-progress .ac-upload-space-progress-bar{background-color:#46b450;height:100%;display:block}.ac-upload-space.warning .ac-upload-space-icon:before{color:#ffb900;content:"\f534";margin-top:1px}.ac-upload-space.warning .ac-upload-space-progress-bar{background-color:#ffb900}.ac-upload-space.full .ac-upload-space-icon:before{color:#d54e21;content:"\f153";margin-top:1px}.ac-upload-space.full .ac-upload-space-progress-bar{background-color:#dc3232}#form-site-list .tablenav .actions .cpac-edit{float:none}.ac-inline-info{border-radius:3px;min-height:20px;background-color:#e9e9e9;font-size:11px;font-weight:700}.ac-inline-info,.ac-rounded{display:inline-block;min-width:8px;padding:0 6px;text-align:center;margin-right:7px}.ac-rounded{border-radius:10px;height:20px;background-color:#e0e0e0;margin-left:7px;font-size:12px}.ac-rounded.ac-rounded-first{margin-left:0}.ac-spacing{display:inline-block;margin-right:10px;margin-bottom:4px}.cpac-suffix{margin-left:8px;color:gray}.ac-small-block{display:inline-block;border-radius:3px;background-color:hsla(0,0%,88%,.6);padding:2px 7px;margin:0 5px 5px 0}.ac-more-link-show{cursor:pointer}.ac-show-more-block{display:none}.ac-more-link-hide{cursor:pointer}.ac-image{display:inline-block;margin-right:2px;overflow:hidden;max-width:100%;background-color:#ccc}.ac-image img{display:block;margin:0 auto}.ac-image .ac-extension{font-size:12px;line-height:22px;display:block;text-align:center;text-transform:uppercase;font-weight:700}.ac-image.ac-icon{background-color:transparent}.rtl .column-column-attachment img{padding-left:5px;padding-right:0}.ac-progress-bar{width:100%;display:flex}.ac-progress-bar .ac-label-main{width:65px}.ac-progress-bar .ac-bar-container{flex:auto;background-color:#fff;min-height:22px;line-height:22px;position:relative;border:1px solid #ccc;border-radius:2px}.ac-progress-bar .ac-bar-container .ac-bar{height:100%;background-color:#69c471;border-right:1px solid #fff}.ac-progress-bar .ac-bar-container .ac-label-left,.ac-progress-bar .ac-bar-container .ac-label-right{text-shadow:hsla(0,0%,100%,.65) 0 0 5px;color:#555;position:absolute}.ac-progress-bar .ac-bar-container .ac-label-left{left:5px}.ac-progress-bar .ac-bar-container .ac-label-right{right:5px}.ac-progress-bar.full .ac-bar-container .ac-bar{background-color:rgba(255,0,0,.45);border:none}.ac-progress-bar.dark .ac-bar-container{flex:auto;background-color:#a6a6a6;min-height:22px;line-height:22px;position:relative}.ac-progress-bar.dark .ac-bar-container .ac-bar{height:100%;background-color:#46b450;border-right:1px solid #fff}.ac-progress-bar.dark .ac-bar-container .ac-label-left{color:#fff;position:absolute;left:5px}.ac-progress-bar.dark .ac-bar-container .ac-label-right{color:#fff;position:absolute;right:5px}.ac-progress-bar.dark.full .ac-bar-container .ac-bar{background-color:rgba(255,0,0,.68);border:none}div.cpac-color{line-height:26px}div.cpac-color span{display:block;border-radius:3px;color:#fff;float:left;height:16px;line-height:16px;margin-right:12px;overflow:hidden;padding:4px 5px;font-size:10px;font-family:Monaco,Menlo,Consolas,Courier New,monospace;min-width:47px;text-align:center}.rtl div.cpac-color span{float:right;margin-left:12px;margin-right:0}div.sizes span.not-available{color:#999}.button.cpac-button-action{position:relative;text-indent:9999px;margin-right:4px;padding:0 13px;overflow:hidden}.button.cpac-button-action:before{position:absolute;top:0;left:0;width:100%;height:100%;text-indent:0}.column-actions.cpac_use_icons .row-actions>span a,.cpac_wp_button{color:#555;background:#f7f7f7;box-shadow:0 1px 0 #ccc;vertical-align:top;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border:1px solid #ccc;border-radius:3px;white-space:nowrap;box-sizing:border-box}.column-actions.cpac_use_icons .row-actions>span a:hover,.cpac_wp_button:hover{background:#fafafa;color:#23282d;border-color:#999}.column-actions .row-actions{left:0;position:relative}.column-actions.cpac_use_icons .row-actions>span{color:transparent;margin-right:-8px}.column-actions.cpac_use_icons .row-actions>span a{display:inline-block;position:relative;min-width:26px;margin-bottom:5px}.column-actions.cpac_use_icons .row-actions>span a:before{text-indent:0;font-family:Dashicons,sans-serif;font-size:16px;position:absolute;padding-left:4px;top:0;left:0;width:100%;height:100%}.column-actions.cpac_use_icons .row-actions>span.approve a,.column-actions.cpac_use_icons .row-actions>span.delete a,.column-actions.cpac_use_icons .row-actions>span.edit a,.column-actions.cpac_use_icons .row-actions>span.inline a,.column-actions.cpac_use_icons .row-actions>span.quickedit a,.column-actions.cpac_use_icons .row-actions>span.reply a,.column-actions.cpac_use_icons .row-actions>span.spam a,.column-actions.cpac_use_icons .row-actions>span.trash a,.column-actions.cpac_use_icons .row-actions>span.unapprove a,.column-actions.cpac_use_icons .row-actions>span.unspam a,.column-actions.cpac_use_icons .row-actions>span.untrash a,.column-actions.cpac_use_icons .row-actions>span.view a{text-indent:-3000px}.column-actions.cpac_use_icons .row-actions>span.approve a:before,.column-actions.cpac_use_icons .row-actions>span.delete a:before,.column-actions.cpac_use_icons .row-actions>span.edit a:before,.column-actions.cpac_use_icons .row-actions>span.inline a:before,.column-actions.cpac_use_icons .row-actions>span.quickedit a:before,.column-actions.cpac_use_icons .row-actions>span.reply a:before,.column-actions.cpac_use_icons .row-actions>span.spam a:before,.column-actions.cpac_use_icons .row-actions>span.trash a:before,.column-actions.cpac_use_icons .row-actions>span.unapprove a:before,.column-actions.cpac_use_icons .row-actions>span.unspam a:before,.column-actions.cpac_use_icons .row-actions>span.untrash a:before,.column-actions.cpac_use_icons .row-actions>span.view a:before{text-indent:0;font-family:Dashicons,sans-serif}.column-actions.cpac_use_icons .row-actions>span.edit a:before{content:"\f464"}.column-actions.cpac_use_icons .row-actions>span.inline a:before,.column-actions.cpac_use_icons .row-actions>span.quickedit a:before{content:"\f119"}.column-actions.cpac_use_icons .row-actions>span.trash a{border-radius:3px;border:1px solid #ccc}.column-actions.cpac_use_icons .row-actions>span.trash a:before{content:"\f182"}.column-actions.cpac_use_icons .row-actions>span.trash a:hover{border-color:#999}.column-actions.cpac_use_icons .row-actions>span.view a:before{content:"\f177"}.column-actions.cpac_use_icons .row-actions>span.unapprove a:before{content:"\f158"}.column-actions.cpac_use_icons .row-actions>span.approve a:before{content:"\f147"}.column-actions.cpac_use_icons .row-actions>span.spam a:before{content:"\f117"}.column-actions.cpac_use_icons .row-actions>span.reply a:before{content:"\f473"}.column-actions.cpac_use_icons .row-actions>span.unspam a:before,.column-actions.cpac_use_icons .row-actions>span.untrash a:before{content:"\f171"}.column-actions.cpac_use_icons .row-actions>span.delete a:before{content:"\f182"}@media screen and (max-width:782px){.wp-list-table.widefat thead th{display:none}.wp-list-table.widefat thead th.column-primary{display:table-cell}.wp-list-table.widefat tbody tr:not(.inline-edit-row):not(.no-items) td{display:none}.wp-list-table.widefat tbody tr:not(.inline-edit-row):not(.no-items) td.column-primary{display:block}}.ac-tip{display:inline-block}.qtip.qtip-tipsy{background:rgba(0,0,0,.75);font-weight:400;min-width:25px}
1
+ @charset "UTF-8";@font-face{font-family:cpac_icons;src:url(../fonts/cpac_icons.woff) format("woff")}[class*=" cpacicon-"],[class^=cpacicon-]{font-family:cpac_icons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[class*=" cpacicon-"]:before,[class^=cpacicon-]:before{font-size:100%}.cpacicon-draft:before{content:""}.cpacicon-move:before{content:""}.column-status .dashicons{font-size:22px}.column-status .dashicons.large{width:25px;height:28px;font-size:28px}.column-status .dashicons.dashicons-lock{font-size:15px;margin-left:-2px}.ac-image-sizes .ac-missing-size{color:#929292}.ac-comment-bubble .post-com-count{display:inline-block;vertical-align:top}.ac-comment-bubble .post-com-count-approved,.ac-comment-bubble .post-com-count-no-comments{margin-top:5px}.ac-comment-bubble .comment-count-approved,.ac-comment-bubble .comment-count-no-comments{box-sizing:border-box;display:block;padding:0 8px;min-width:24px;height:2em;border-radius:5px;background-color:#72777c;color:#fff;font-size:11px;line-height:21px;text-align:center}.ac-comment-bubble .post-com-count-approved:after,.ac-comment-bubble .post-com-count-no-comments:after{content:"";display:block;margin-left:8px;width:0;height:0;border-top:5px solid #72777c;border-right:5px solid transparent}.ac-comment-bubble .post-com-count-approved:focus .comment-count-approved,.ac-comment-bubble .post-com-count-approved:hover .comment-count-approved{background:#0073aa}.ac-comment-bubble .post-com-count-approved:focus:after,.ac-comment-bubble .post-com-count-approved:hover:after{border-top-color:#0073aa}.ac-comment-bubble .post-com-count-pending{position:relative;left:-3px;padding:0 5px;min-width:7px;height:17px;border:2px solid #fff;border-radius:11px;background:#ca4a1f;color:#fff;font-size:9px;line-height:17px;text-align:center}.ac-comment-bubble .post-com-count-no-pending{display:none}.ac-divider{display:inline-block;width:14px;height:12px;background:transparent url(../images/square.png) no-repeat 50% 7px}span.status-closed{color:red}.ac-value-stars{white-space:nowrap;word-wrap:normal;display:block}.ac-value-stars .ac-value-star{font-size:16px;width:auto;margin-right:-3px}.actions #post-query-submit,.tablenav.top .ac-button{float:left;vertical-align:middle;margin-bottom:4px}.tablenav.top .ac-button{top:2px;display:inline-block}body.edit-tags-php .tablenav.top .ac-button{float:none}span.dashicons.flip:before{transform:scaleX(-1);display:inline-block}span.dashicons.yellow{color:#ffb900}span.dashicons.orange{color:#d54e21}span.dashicons.red{color:#dc3232}span.dashicons.green{color:#46b450}span.dashicons.light-gray{color:#bbb}span.dashicons.gray{color:#8a8a8a}span.dashicons.blue{color:#0073aa}span.dashicons.light-blue{color:#00a0d2}body.edit-php #delete_all{float:left;margin-right:3px}body.users-php .tablenav .actions a.add-new-h2{float:none;vertical-align:middle!important;top:2px!important}@media screen and (max-width:782px){.tablenav.top .actions{display:block!important;margin-bottom:4px}.tablenav.top .actions *{display:none}.tablenav.top .actions .ac-button{display:inline-block}}body.upload-php .tablenav.top .ac-button{float:none}.ac-toggle-box-link:focus{outline:none;box-shadow:none}.ac-toggle-box-link .spinner{float:none;margin-top:-2px}.ac-toggle-box-link.loading .spinner{visibility:visible}.ac-toggle-box-contents-ajax{padding:5px 0 0}.ac-toggle-box-contents{display:none;padding:5px 0 0}table.ac-table-items{border-spacing:0}table.ac-table-items tr td{border:0;margin:0;padding:0 0 3px}table.ac-table-items tr td.ac-table-item-qty{color:#999;padding-right:6px;text-align:left}.ac-post-state-format:before{color:#a7a7a7}.ac-image-details .ac-image-info{display:inline-block;border-radius:7px;padding:0 9px;min-height:20px;background-color:#e9e9e9;text-align:left;font-size:11px;font-weight:700;margin:0 6px 5px 0;white-space:nowrap}.ac-image-details .ac-image-info>span{margin-right:6px}.ac-image-details .ac-image-info>span:last-child{margin-right:0}.ac-image-details .ac-image-info span{vertical-align:middle;line-height:20px}.ac-image-details .ac-image-info span.image-id{font-size:11px;color:#757575}.ac-image-details .ac-image-info span.image-file-size{font-size:12px}.ac-image-details .ac-image-info span.image-extension{text-transform:uppercase;font-size:11px;color:#757575}.ac-image-details .ac-image-info span.suffix{display:inline-block;text-transform:uppercase;font-size:10px;color:#757575;padding-left:3px;margin-top:-2px}.ac-image-details .ac-image-info span.dashicons{margin-top:-2px;color:#757575;font-size:14px;width:16px}.ac-image-details a.ac-image-info:hover{color:#0073aa}.ac-image-details a.ac-image-info:hover span.dashicons{color:#3d4350}.ac-upload-space .ac-upload-space-labels{display:table;width:100%}.ac-upload-space .ac-upload-space-labels .inner{display:table-row}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-icon{display:table-cell}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-icon:before{color:#82878c;content:"\f104";display:inline-block;font-family:dashicons,serif;width:20px;height:20px;font-size:18px;line-height:1;text-decoration:inherit;font-weight:400;font-style:normal;vertical-align:top;text-align:center;margin-right:4px}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-left{display:table-cell;white-space:nowrap}.ac-upload-space .ac-upload-space-labels .inner .ac-upload-space-right{width:100%;text-align:right;padding-left:6px;display:table-cell;white-space:nowrap}.ac-upload-space .ac-upload-space-progress{margin-top:6px;height:3px;background:#fff;border:1px solid #dfdfdf;position:relative}.ac-upload-space .ac-upload-space-progress .ac-upload-space-progress-bar{background-color:#46b450;height:100%;display:block}.ac-upload-space.warning .ac-upload-space-icon:before{color:#ffb900;content:"\f534";margin-top:1px}.ac-upload-space.warning .ac-upload-space-progress-bar{background-color:#ffb900}.ac-upload-space.full .ac-upload-space-icon:before{color:#d54e21;content:"\f153";margin-top:1px}.ac-upload-space.full .ac-upload-space-progress-bar{background-color:#dc3232}#form-site-list .tablenav .actions .ac-button{float:none}.ac-inline-info{border-radius:3px;min-height:20px;background-color:#e9e9e9;font-size:11px;font-weight:700}.ac-inline-info,.ac-rounded{display:inline-block;min-width:8px;padding:0 6px;text-align:center;margin-right:7px}.ac-rounded{border-radius:10px;height:20px;background-color:#e0e0e0;margin-left:7px;font-size:12px}.ac-rounded.ac-rounded-first{margin-left:0}.ac-spacing{display:inline-block;margin-right:10px;margin-bottom:4px}.cpac-suffix{margin-left:8px;color:gray}.ac-small-block{display:inline-block;border-radius:3px;background-color:hsla(0,0%,88%,.6);padding:2px 7px;margin:0 5px 5px 0}.ac-more-link-show{cursor:pointer}.ac-show-more-block{display:none}.ac-more-link-hide{cursor:pointer}.ac-image-container{margin-bottom:-6px}.ac-image{display:inline-block;margin-right:2px;margin-bottom:6px;overflow:hidden;max-width:100%;background-color:#ccc;vertical-align:middle}.ac-image img{display:block;margin:0 auto}.ac-image .ac-extension{font-size:12px;line-height:22px;display:block;text-align:center;text-transform:uppercase;font-weight:700}.ac-image.ac-icon{background-color:transparent}.rtl .column-column-attachment img{padding-left:5px;padding-right:0}.ac-progress-bar{width:100%;display:flex}.ac-progress-bar .ac-label-main{width:65px}.ac-progress-bar .ac-bar-container{flex:auto;background-color:#fff;min-height:22px;line-height:22px;position:relative;border:1px solid #ccc;border-radius:2px}.ac-progress-bar .ac-bar-container .ac-bar{height:100%;background-color:#69c471;border-right:1px solid #fff}.ac-progress-bar .ac-bar-container .ac-label-left,.ac-progress-bar .ac-bar-container .ac-label-right{text-shadow:hsla(0,0%,100%,.65) 0 0 5px;color:#555;position:absolute}.ac-progress-bar .ac-bar-container .ac-label-left{left:5px}.ac-progress-bar .ac-bar-container .ac-label-right{right:5px}.ac-progress-bar.full .ac-bar-container .ac-bar{background-color:rgba(255,0,0,.45);border:none}.ac-progress-bar.dark .ac-bar-container{flex:auto;background-color:#a6a6a6;min-height:22px;line-height:22px;position:relative}.ac-progress-bar.dark .ac-bar-container .ac-bar{height:100%;background-color:#46b450;border-right:1px solid #fff}.ac-progress-bar.dark .ac-bar-container .ac-label-left{color:#fff;position:absolute;left:5px}.ac-progress-bar.dark .ac-bar-container .ac-label-right{color:#fff;position:absolute;right:5px}.ac-progress-bar.dark.full .ac-bar-container .ac-bar{background-color:rgba(255,0,0,.68);border:none}div.cpac-color{line-height:26px}div.cpac-color span{display:block;border-radius:3px;color:#fff;float:left;height:16px;line-height:16px;margin-right:12px;overflow:hidden;padding:4px 5px;font-size:10px;font-family:Monaco,Menlo,Consolas,Courier New,monospace;min-width:47px;text-align:center}.rtl div.cpac-color span{float:right;margin-left:12px;margin-right:0}.button.cpac-button-action{position:relative;text-indent:9999px;margin-right:4px;padding:0 13px;overflow:hidden}.button.cpac-button-action:before{position:absolute;top:0;left:0;width:100%;height:100%;text-indent:0}.column-actions.cpac_use_icons .row-actions>span a,.cpac_wp_button{color:#555;background:#f7f7f7;box-shadow:0 1px 0 #ccc;vertical-align:top;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border:1px solid #ccc;border-radius:3px;white-space:nowrap;box-sizing:border-box}.column-actions.cpac_use_icons .row-actions>span a:hover,.cpac_wp_button:hover{background:#fafafa;color:#23282d;border-color:#999}.column-actions .row-actions{left:0;position:relative}.column-actions.cpac_use_icons .row-actions>span{color:transparent;margin-right:-8px}.column-actions.cpac_use_icons .row-actions>span a{display:inline-block;position:relative;min-width:26px;margin-bottom:5px}.column-actions.cpac_use_icons .row-actions>span a:before{text-indent:0;font-family:Dashicons,sans-serif;font-size:16px;position:absolute;padding-left:4px;top:0;left:0;width:100%;height:100%}.column-actions.cpac_use_icons .row-actions>span.activate a,.column-actions.cpac_use_icons .row-actions>span.approve a,.column-actions.cpac_use_icons .row-actions>span.archive a,.column-actions.cpac_use_icons .row-actions>span.backend a,.column-actions.cpac_use_icons .row-actions>span.deactivate a,.column-actions.cpac_use_icons .row-actions>span.delete a,.column-actions.cpac_use_icons .row-actions>span.download a,.column-actions.cpac_use_icons .row-actions>span.edit a,.column-actions.cpac_use_icons .row-actions>span.inline a,.column-actions.cpac_use_icons .row-actions>span.quickedit a,.column-actions.cpac_use_icons .row-actions>span.reply a,.column-actions.cpac_use_icons .row-actions>span.spam a,.column-actions.cpac_use_icons .row-actions>span.trash a,.column-actions.cpac_use_icons .row-actions>span.unapprove a,.column-actions.cpac_use_icons .row-actions>span.unarchive a,.column-actions.cpac_use_icons .row-actions>span.unspam a,.column-actions.cpac_use_icons .row-actions>span.untrash a,.column-actions.cpac_use_icons .row-actions>span.view a,.column-actions.cpac_use_icons .row-actions>span.visit a{text-indent:-3000px}.column-actions.cpac_use_icons .row-actions>span.activate a:before,.column-actions.cpac_use_icons .row-actions>span.approve a:before,.column-actions.cpac_use_icons .row-actions>span.archive a:before,.column-actions.cpac_use_icons .row-actions>span.backend a:before,.column-actions.cpac_use_icons .row-actions>span.deactivate a:before,.column-actions.cpac_use_icons .row-actions>span.delete a:before,.column-actions.cpac_use_icons .row-actions>span.download a:before,.column-actions.cpac_use_icons .row-actions>span.edit a:before,.column-actions.cpac_use_icons .row-actions>span.inline a:before,.column-actions.cpac_use_icons .row-actions>span.quickedit a:before,.column-actions.cpac_use_icons .row-actions>span.reply a:before,.column-actions.cpac_use_icons .row-actions>span.spam a:before,.column-actions.cpac_use_icons .row-actions>span.trash a:before,.column-actions.cpac_use_icons .row-actions>span.unapprove a:before,.column-actions.cpac_use_icons .row-actions>span.unarchive a:before,.column-actions.cpac_use_icons .row-actions>span.unspam a:before,.column-actions.cpac_use_icons .row-actions>span.untrash a:before,.column-actions.cpac_use_icons .row-actions>span.view a:before,.column-actions.cpac_use_icons .row-actions>span.visit a:before{text-indent:0;font-family:Dashicons,sans-serif}.column-actions.cpac_use_icons .row-actions>span.edit a:before{content:"\f464"}.column-actions.cpac_use_icons .row-actions>span.inline a:before,.column-actions.cpac_use_icons .row-actions>span.quickedit a:before{content:"\f119"}.column-actions.cpac_use_icons .row-actions>span.trash a{border-radius:3px;border:1px solid #ccc}.column-actions.cpac_use_icons .row-actions>span.trash a:before{content:"\f182"}.column-actions.cpac_use_icons .row-actions>span.trash a:hover{border-color:#999}.column-actions.cpac_use_icons .row-actions>span.view a:before{content:"\f177"}.column-actions.cpac_use_icons .row-actions>span.unapprove a:before{content:"\f158"}.column-actions.cpac_use_icons .row-actions>span.approve a:before{content:"\f147"}.column-actions.cpac_use_icons .row-actions>span.spam a:before{content:"\f117"}.column-actions.cpac_use_icons .row-actions>span.reply a:before{content:"\f473"}.column-actions.cpac_use_icons .row-actions>span.unspam a:before,.column-actions.cpac_use_icons .row-actions>span.untrash a:before{content:"\f171"}.column-actions.cpac_use_icons .row-actions>span.delete a:before{content:"\f182"}.column-actions.cpac_use_icons .row-actions>span.backend a:before{content:"\f226"}.column-actions.cpac_use_icons .row-actions>span.visit a:before{content:"\f115"}.column-actions.cpac_use_icons .row-actions>span.deactivate a:before{content:"\f530"}.column-actions.cpac_use_icons .row-actions>span.archive a:before{content:"\f480"}.column-actions.cpac_use_icons .row-actions>span.unarchive a:before{content:"\f322"}.column-actions.cpac_use_icons .row-actions>span.activate a:before{content:"\f177"}.column-actions.cpac_use_icons .row-actions>span.download a:before{content:"\f316"}@media screen and (max-width:782px){.wp-list-table.widefat thead th{display:none}.wp-list-table.widefat thead th.column-primary{display:table-cell}.wp-list-table.widefat tbody tr:not(.inline-edit-row):not(.no-items) td{display:none}.wp-list-table.widefat tbody tr:not(.inline-edit-row):not(.no-items) td.column-primary{display:block}}.ac-tip{display:inline-block}.qtip.qtip-tipsy{background:rgba(0,0,0,.75);font-weight:400;min-width:25px}
assets/images/addons/events-calendar-icon.png ADDED
Binary file
assets/images/addons/events-calendar.png ADDED
Binary file
assets/images/addons/ninja-forms-icon.png ADDED
Binary file
assets/images/addons/ninja-forms.png ADDED
Binary file
assets/js/admin-page-columns.js CHANGED
@@ -181,6 +181,7 @@ function cpac_init( $ ) {
181
$( col ).column_bind_remove();
182
$( col ).column_bind_clone();
183
$( col ).cpac_bind_indicator_events();
184
} );
185
186
// ordering of columns
@@ -371,6 +372,16 @@ function cpac_reset_columns( $ ) {
371
} );
372
};
373
374
/*
375
* Form Events
376
*
@@ -380,6 +391,7 @@ function cpac_reset_columns( $ ) {
380
var column = $( this );
381
var container = column.closest( '.ac-admin ' );
382
383
// Current column type
384
var default_value = column.find( 'select.ac-setting-input_type option:selected' ).val();
385
@@ -486,12 +498,6 @@ function cpac_reset_columns( $ ) {
486
column.cpac_column_refresh();
487
} );
488
489
- /** When an label contains an icon or span, the displayed label can appear empty. In this case we show the "type" label. */
490
- var column_label = column.find( '.column_label .toggle' );
491
- if ( $.trim( column_label.html() ) && column_label.width() < 1 ) {
492
- column_label.html( column.find( '.column_type .inner' ).html() );
493
- }
494
-
495
$( document ).trigger( 'init_settings', column );
496
};
497
@@ -724,6 +730,7 @@ function cpac_reset_columns( $ ) {
724
725
$( document ).on( 'init_settings', function( e, column ) {
726
$( column ).find( '.ac-column-setting--image' ).cpac_column_setting_image_size();
727
} );
728
729
// Settings fields: Width
181
$( col ).column_bind_remove();
182
$( col ).column_bind_clone();
183
$( col ).cpac_bind_indicator_events();
184
+ $( col ).column_onload();
185
} );
186
187
// ordering of columns
372
} );
373
};
374
375
+ $.fn.column_onload = function() {
376
+ var column = $( this );
377
+
378
+ /** When an label contains an icon or span, the displayed label can appear empty. In this case we show the "type" label. */
379
+ var column_label = column.find( '.column_label .toggle' );
380
+ if ( $.trim( column_label.html() ) && column_label.width() < 1 ) {
381
+ column_label.html( column.find( '.column_type .inner' ).html() );
382
+ }
383
+ };
384
+
385
/*
386
* Form Events
387
*
391
var column = $( this );
392
var container = column.closest( '.ac-admin ' );
393
394
+ column.column_onload();
395
// Current column type
396
var default_value = column.find( 'select.ac-setting-input_type option:selected' ).val();
397
498
column.cpac_column_refresh();
499
} );
500
501
$( document ).trigger( 'init_settings', column );
502
};
503
730
731
$( document ).on( 'init_settings', function( e, column ) {
732
$( column ).find( '.ac-column-setting--image' ).cpac_column_setting_image_size();
733
+ $( column ).find( '.ac-column-setting--images' ).cpac_column_setting_image_size();
734
} );
735
736
// Settings fields: Width
assets/js/admin-page-columns.min.js CHANGED
@@ -1 +1 @@
1
- function ac_show_ajax_message(n,e){var t=jQuery('<div class="ac-message hidden '+e+'"><p>'+n+"</p></div>");jQuery(".ac-boxes").before(t),t.slideDown()}function cpac_submit_form(n){var e=n(".sidebox a.submit, .column-footer a.submit");e.click(function(){var t=n(this),i=t.closest(".ac-admin").addClass("saving"),a=i.find(".ac-columns form").serialize();e.attr("disabled","disabled"),i.find(".ac-message").remove();var c=n.post(ajaxurl,{action:"ac_columns_save",data:a,_ajax_nonce:AC._ajax_nonce,list_screen:AC.list_screen,layout:AC.layout,original_columns:AC.original_columns},function(n){n&&(n.success?(ac_show_ajax_message(n.data,"updated"),i.addClass("stored")):n.data&&ac_show_ajax_message(n.data.message,"notice notice-warning"))},"json");c.fail(function(n){}),c.always(function(){e.removeAttr("disabled","disabled"),i.removeClass("saving")}),n(document).trigger("cac_update",i)})}function cpac_add_column(n){n(".add_column").click(function(e){e.preventDefault();var t=n("#add-new-column-template").find(".ac-column").clone();t.cpac_update_clone_id(),t.addClass("opened").find(".ac-column-body").slideDown(150,function(){n("html, body").animate({scrollTop:t.offset().top-58},300)}),n(".ac-columns form").append(t),t.column_bind_toggle(),t.column_bind_remove(),t.column_bind_clone(),t.column_bind_events(),n(document).trigger("column_add",t)})}function cpac_sidebar_feedback(n){var e=n(".sidebox#direct-feedback");e.find("#feedback-choice a.no").click(function(n){n.preventDefault(),e.find("#feedback-choice").slideUp(),e.find("#feedback-support").slideDown()}),e.find("#feedback-choice a.yes").click(function(n){n.preventDefault(),e.find("#feedback-choice").slideUp(),e.find("#feedback-rate").slideDown()})}function cpac_init(n){var e=n(".ac-admin"),t=e.find(".ac-boxes");if(t.hasClass("disabled"))t.find(".ac-column").each(function(e,t){n(t).column_bind_toggle(),n(t).find("input, select").prop("disabled",!0)});else{var i=t.find(".ac-columns");i.find(".ac-column").each(function(e,t){n(t).column_bind_toggle(),n(t).column_bind_remove(),n(t).column_bind_clone(),n(t).cpac_bind_indicator_events()}),i.cpac_bind_ordering()}n(document).trigger("cac_menu_change",i),n(document).trigger("cac_model_ready",e.data("type"))}function cpac_menu(n){n("#ac_list_screen").on("change",function(){n(".view-link").hide(),n(this).parents("form").submit(),n(this).prop("disabled",!0).next(".spinner").css("display","inline-block")})}function cpac_reset_columns(n){var e=n(".ac-admin");n("a[data-clear-columns]").on("click",function(){e.find(".ac-column").each(function(){n(this).find(".remove-button").trigger("click")})})}var AC,incremental_column_name=0;jQuery(document).ready(function(n){if(0===n("#cpac").length)return!1;cpac_init(n),cpac_submit_form(n),cpac_reset_columns(n),cpac_menu(n),cpac_add_column(n),cpac_sidebar_feedback(n)}),function(n){n.fn.column_bind_toggle=function(){var e=n(this),t=e.closest(".ac-boxes").hasClass("disabled");e.find('[data-toggle="column"]').click(function(i){i.preventDefault(),e.toggleClass("opened").find(".ac-column-body").slideToggle(150),t||(e.hasClass("events-binded")||e.column_bind_events(),e.addClass("events-binded"),n(document).trigger("column_init",e))}).css("cursor","pointer")},n.fn.column_bind_remove=function(){n(this).find(".remove-button").click(function(e){n(this).closest(".ac-column").column_remove(),e.preventDefault()})},n.fn.column_bind_clone=function(){n(this).find(".clone-button").click(function(e){e.preventDefault();var t=n(this).closest(".ac-column").column_clone();void 0!==t&&t.removeClass("loading").hide().slideDown()})},n.fn.cpac_column_refresh=function(){var e=n(this),t=e.find('[data-refresh="column"]'),i=n(this).attr("data-column-name"),a=e.hasClass("opened");n(document).trigger("pre_column_refresh",e);var c=n(this).find(":input").serializeArray(),o={action:"ac_column_refresh",_ajax_nonce:AC._ajax_nonce,list_screen:AC.list_screen,layout:AC.layout,column_name:i,original_columns:AC.original_columns};n.each(o,function(n,e){c.push({name:n,value:e})}),e.addClass("loading"),t.prop("disabled",1);var l=n.post(ajaxurl,c,function(t){if(t){var i=n("<div>"+t.data+"</div>").children();e.replaceWith(i),e=i,e.column_bind_toggle(),e.column_bind_remove(),e.column_bind_clone(),e.column_bind_events(),a&&e.addClass("opened").find(".ac-column-body").show(),n(document).trigger("column_change",e)}},"json");l.fail(function(n){var t=e.closest(".ac-admin").find(".ajax-message");t.addClass("error").find("p").html(AC.i18n.error),t.slideDown(),e.slideUp(function(){e.remove()}),console.log("responseText: "+n.responseText)}),l.always(function(){e.removeClass("loading"),t.prop("disabled",!1)})},n.fn.column_bind_events=function(){var e=n(this),t=e.closest(".ac-admin "),i=e.find("select.ac-setting-input_type option:selected").val();e.find("select.ac-setting-input_type").change(function(){var a=n("optgroup",this).children(":selected"),c=a.val(),o=n(this).next(".msg").hide(),l=n(this),s=[];t.find(".ac-column[data-original=1]").each(function(){s.push(n(this).data("type"))}),e.addClass("loading"),n.ajax({url:ajaxurl,method:"post",dataType:"json",data:{action:"ac_column_select",type:c,current_original_columns:s,original_columns:AC.original_columns,list_screen:AC.list_screen,layout:AC.layout,_ajax_nonce:AC._ajax_nonce}}).done(function(t){if(t)if(t.success){var a=e.closest(".ac-column"),c=n("<div>"+t.data+"</div>").children();a.replaceWith(c),a=c,a.column_bind_toggle(),a.column_bind_remove(),a.column_bind_clone(),a.column_bind_events(),a.addClass("opened").find(".ac-column-body").show(),a.cpac_update_clone_id(),n(document).trigger("column_change",a)}else t.data&&"message"===t.data.type&&(o.html(t.data.error).show(),l.find("option").removeAttr("selected"),l.find('option[value="'+i+'"]').attr("selected","selected"))}).always(function(){e.removeClass("loading")})}),e.find(".ac-column-setting--label input").bind("keyup change",function(){var e=n(this).val();n(this).closest(".ac-column").find("td.column_label .inner > a.toggle").html(e)}),e.find(".ac-column-body .col-label .label").hover(function(){n(this).parents(".col-label").find("div.tooltip").show()},function(){n(this).parents(".col-label").find("div.tooltip").hide()}),e.find('select[data-label="update"]').change(function(){var t=e.find("input.ac-setting-input_label"),i=n(this).find("option:selected").text();t.val(i),t.trigger("change")}),e.find('[data-refresh="column"]').change(function(){e.cpac_column_refresh()});var a=e.find(".column_label .toggle");n.trim(a.html())&&a.width()<1&&a.html(e.find(".column_type .inner").html()),n(document).trigger("init_settings",e)},n.fn.column_bind_settings=function(){var e=n(this);e.find(".ac-column-setting--image_size").cpac_column_setting_image_size(),e.find(".ac-column-setting--width").cpac_column_setting_width()},n.fn.column_remove=function(){n(this).addClass("deleting").animate({opacity:0,height:0},350,function(){n(this).remove()})},n.fn.column_clone=function(){var e=n(this),t=n(this).closest("ac-columns");if("1"===e.attr("data-original")){var i=AC.i18n.clone.replace("%s","<strong>"+e.find(".column_label .toggle").text()+"</strong>");return e.addClass("opened").find(".ac-column-body").slideDown(150),void e.find(".ac-setting-input_type").next(".msg").html(i).show()}var a=n(this).clone();return a.cpac_update_clone_id(),n(this).after(a),a.column_bind_toggle(),a.column_bind_remove(),a.column_bind_clone(),a.column_bind_events(),t.cpac_bind_ordering(),n(document).trigger("column_add",a),a},n.fn.cpac_update_clone_id=function(){var e=n(this),t=e.attr("data-column-name"),i="_new_column_"+incremental_column_name,a=e.find("input, select, label");n(a).each(function(e,a){n(a).attr("name")&&n(a).attr("name",n(a).attr("name").replace("columns["+t+"]","columns["+i+"]")),n(a).attr("id")&&n(a).attr("id",n(a).attr("id").replace("-"+t+"-","-"+i+"-"))}),e.attr("data-column-name",i),incremental_column_name++},n(document).bind("column_init column_change column_add",function(e,t){n(t).closest(".ac-boxes").hasClass("disabled")||(n(t).cpac_bind_column_addon_events(),n(t).cpac_bind_indicator_events())}),n.fn.cpac_bind_column_addon_events=function(){var e=n(this);e.find("[data-trigger] label").on("click",function(){var t=n(this).closest("td.input").data("trigger"),i=n("input",this).val(),a=e.find('[data-indicator-id="'+t+'"]').removeClass("on");"on"==i&&a.addClass("on");var c=e.find('[data-handle="'+t+'"]').addClass("hide");"on"==i&&c.removeClass("hide")}),e.find("[data-trigger]").each(function(){var t=n(this).data("trigger"),i=e.find('[data-handle="'+t+'"]').addClass("hide");"on"==n("input:checked",this).val()&&i.removeClass("hide")})},n.fn.cpac_bind_indicator_events=function(){var e=n(this);e.find(".ac-column-header [data-indicator-toggle]").each(function(){var t=n(this),i=n(this).data("setting"),a=e.find(".ac-column-setting[data-setting="+i+"]"),c=a.find(".col-input:first .ac-setting-input:first input[type=radio]");t.unbind("click").on("click",function(e){e.preventDefault(),t.toggleClass("on"),n(this).hasClass("on")?c.filter("[value=on]").prop("checked",!0).trigger("click").trigger("change"):c.filter("[value=off]").prop("checked",!0).trigger("click").trigger("change")}),c.on("change",function(){"on"==c.filter(":checked").val()?t.addClass("on"):t.removeClass("on")})})},n.fn.cpac_bind_ordering=function(){n(this).each(function(){n(this).hasClass("ui-sortable")?n(this).sortable("refresh"):n(this).sortable({items:".ac-column",handle:".column_sort"})})},n.fn.cpac_column_setting_image_size=function(){function e(n,e){"cpac-custom"==e.val()?n.find(".ac-column-setting").show():n.find(".ac-column-setting").hide()}n(this).each(function(){var t=n(this),i=n(this).find(".ac-setting-input select");e(t,i),i.on("change",function(){e(t,n(this))})})},n(document).on("init_settings",function(e,t){n(t).find(".ac-column-setting--image").cpac_column_setting_image_size()}),n.fn.column_width_slider=function(){var e=n(this).find(".ac-setting-input-width"),t=e.find(".description input"),i=e.find(".unit-select input"),a=i.filter(":checked").val(),c=t.val(),o=e.find(".width-slider"),l=n(this).find(".ac-column-header .ac-column-heading-setting--width");"%"==a&&c>100&&(c=100),t.val(c),o.slider({range:"min",min:0,max:"%"==a?100:500,value:c,slide:function(n,e){t.val(e.value),l.trigger("update"),t.trigger("validate")}})},n.fn.cpac_column_setting_width=function(){n(this).each(function(){var e=n(this).parents(".ac-column");e.column_width_slider();var t=e.find(".ac-column-header .ac-column-heading-setting--width");t.on("update",function(){var t=e.find(".ac-setting-input-width .description input").val(),i=e.find(".ac-setting-input-width .description .unit").text();t>0?n(this).text(t+i):n(this).text("")}),e.find(".ac-setting-input-width .unit-select label").on("click",function(){e.find("span.unit").text(n(this).find("input").val()),e.column_width_slider(),t.trigger("update")});var i=e.find(".ac-setting-input-width .description input").on("keyup",function(){e.column_width_slider(),n(this).trigger("validate"),t.trigger("update")}).on("validate",function(){var e=i.val(),t=n.trim(e);n.isNumeric(t)||(t=t.replace(/\D/g,"")),t.length>3&&(t=t.substring(0,3)),t<=0&&(t=""),t!==e&&i.val(t)})})},n.fn.cpac_column_sub_setting_toggle=function(e){function t(n,e){var t=e.filter(":checked").val(),a=n.find(i.subfield);i.value_show==t?a.show():a.hide()}var i=n.extend({value_show:"on",subfield:".ac-column-setting"},e);n(this).each(function(){var e=n(this),i=n(this).find('.ac-setting-input input[type="radio"]');t(e,i),i.on("change",function(){t(e,i)})})},n.fn.cpac_column_setting_date=function(){n(this).each(function(){var e=n(this),t=e.find("input.custom"),i=e.find(".ac-setting-input-date__custom"),a=e.find(".ac-setting-input-date__value"),c=e.find(".ac-setting-input-date__example"),o=e.find("input[type=radio]:checked"),l=e.find(".help-msg");e.find("input[type=radio]").on("change",function(){var e=n(this),t=e.closest("label"),o=t.find("code").text(),s=t.find(".ac-setting-input-date__more").html();o&&i.val(o).trigger("change"),e.hasClass("diff")&&(i.val(""),c.text("")),i.prop("disabled",!0),e.hasClass("custom")&&(e.val(i.val()),i.prop("disabled",!1),l.show()),l.hide(),s&&l.html(s).show(),a.val(e.val())}),i.on("change",function(){c.html('<span class="spinner is-active"></span>'),t.val(i.val());var e=n(this).val();if(!e)return void c.text("");n.ajax({url:ajaxurl,method:"post",data:{action:"date_format",date:e}}).done(function(n){c.text(n)}),a.val(e)}),o.trigger("change"),0===o.length&&t.trigger("click")})},n(document).on("init_settings",function(e,t){n(t).find(".ac-column-setting--width").cpac_column_setting_width(),n(t).find(".ac-column-setting--date").cpac_column_setting_date(),n(t).find(".ac-column-setting--filter").cpac_column_sub_setting_toggle(),n(t).find(".ac-column-setting--sort").cpac_column_sub_setting_toggle(),n(t).find(".ac-column-setting--edit").cpac_column_sub_setting_toggle()})}(jQuery);
1
+ function ac_show_ajax_message(n,e){var t=jQuery('<div class="ac-message hidden '+e+'"><p>'+n+"</p></div>");jQuery(".ac-boxes").before(t),t.slideDown()}function cpac_submit_form(n){var e=n(".sidebox a.submit, .column-footer a.submit");e.click(function(){var t=n(this),i=t.closest(".ac-admin").addClass("saving"),a=i.find(".ac-columns form").serialize();e.attr("disabled","disabled"),i.find(".ac-message").remove();var c=n.post(ajaxurl,{action:"ac_columns_save",data:a,_ajax_nonce:AC._ajax_nonce,list_screen:AC.list_screen,layout:AC.layout,original_columns:AC.original_columns},function(n){n&&(n.success?(ac_show_ajax_message(n.data,"updated"),i.addClass("stored")):n.data&&ac_show_ajax_message(n.data.message,"notice notice-warning"))},"json");c.fail(function(n){}),c.always(function(){e.removeAttr("disabled","disabled"),i.removeClass("saving")}),n(document).trigger("cac_update",i)})}function cpac_add_column(n){n(".add_column").click(function(e){e.preventDefault();var t=n("#add-new-column-template").find(".ac-column").clone();t.cpac_update_clone_id(),t.addClass("opened").find(".ac-column-body").slideDown(150,function(){n("html, body").animate({scrollTop:t.offset().top-58},300)}),n(".ac-columns form").append(t),t.column_bind_toggle(),t.column_bind_remove(),t.column_bind_clone(),t.column_bind_events(),n(document).trigger("column_add",t)})}function cpac_sidebar_feedback(n){var e=n(".sidebox#direct-feedback");e.find("#feedback-choice a.no").click(function(n){n.preventDefault(),e.find("#feedback-choice").slideUp(),e.find("#feedback-support").slideDown()}),e.find("#feedback-choice a.yes").click(function(n){n.preventDefault(),e.find("#feedback-choice").slideUp(),e.find("#feedback-rate").slideDown()})}function cpac_init(n){var e=n(".ac-admin"),t=e.find(".ac-boxes");if(t.hasClass("disabled"))t.find(".ac-column").each(function(e,t){n(t).column_bind_toggle(),n(t).find("input, select").prop("disabled",!0)});else{var i=t.find(".ac-columns");i.find(".ac-column").each(function(e,t){n(t).column_bind_toggle(),n(t).column_bind_remove(),n(t).column_bind_clone(),n(t).cpac_bind_indicator_events(),n(t).column_onload()}),i.cpac_bind_ordering()}n(document).trigger("cac_menu_change",i),n(document).trigger("cac_model_ready",e.data("type"))}function cpac_menu(n){n("#ac_list_screen").on("change",function(){n(".view-link").hide(),n(this).parents("form").submit(),n(this).prop("disabled",!0).next(".spinner").css("display","inline-block")})}function cpac_reset_columns(n){var e=n(".ac-admin");n("a[data-clear-columns]").on("click",function(){e.find(".ac-column").each(function(){n(this).find(".remove-button").trigger("click")})})}var AC,incremental_column_name=0;jQuery(document).ready(function(n){if(0===n("#cpac").length)return!1;cpac_init(n),cpac_submit_form(n),cpac_reset_columns(n),cpac_menu(n),cpac_add_column(n),cpac_sidebar_feedback(n)}),function(n){n.fn.column_bind_toggle=function(){var e=n(this),t=e.closest(".ac-boxes").hasClass("disabled");e.find('[data-toggle="column"]').click(function(i){i.preventDefault(),e.toggleClass("opened").find(".ac-column-body").slideToggle(150),t||(e.hasClass("events-binded")||e.column_bind_events(),e.addClass("events-binded"),n(document).trigger("column_init",e))}).css("cursor","pointer")},n.fn.column_bind_remove=function(){n(this).find(".remove-button").click(function(e){n(this).closest(".ac-column").column_remove(),e.preventDefault()})},n.fn.column_bind_clone=function(){n(this).find(".clone-button").click(function(e){e.preventDefault();var t=n(this).closest(".ac-column").column_clone();void 0!==t&&t.removeClass("loading").hide().slideDown()})},n.fn.cpac_column_refresh=function(){var e=n(this),t=e.find('[data-refresh="column"]'),i=n(this).attr("data-column-name"),a=e.hasClass("opened");n(document).trigger("pre_column_refresh",e);var c=n(this).find(":input").serializeArray(),o={action:"ac_column_refresh",_ajax_nonce:AC._ajax_nonce,list_screen:AC.list_screen,layout:AC.layout,column_name:i,original_columns:AC.original_columns};n.each(o,function(n,e){c.push({name:n,value:e})}),e.addClass("loading"),t.prop("disabled",1);var l=n.post(ajaxurl,c,function(t){if(t){var i=n("<div>"+t.data+"</div>").children();e.replaceWith(i),e=i,e.column_bind_toggle(),e.column_bind_remove(),e.column_bind_clone(),e.column_bind_events(),a&&e.addClass("opened").find(".ac-column-body").show(),n(document).trigger("column_change",e)}},"json");l.fail(function(n){var t=e.closest(".ac-admin").find(".ajax-message");t.addClass("error").find("p").html(AC.i18n.error),t.slideDown(),e.slideUp(function(){e.remove()}),console.log("responseText: "+n.responseText)}),l.always(function(){e.removeClass("loading"),t.prop("disabled",!1)})},n.fn.column_onload=function(){var e=n(this),t=e.find(".column_label .toggle");n.trim(t.html())&&t.width()<1&&t.html(e.find(".column_type .inner").html())},n.fn.column_bind_events=function(){var e=n(this),t=e.closest(".ac-admin ");e.column_onload();var i=e.find("select.ac-setting-input_type option:selected").val();e.find("select.ac-setting-input_type").change(function(){var a=n("optgroup",this).children(":selected"),c=a.val(),o=n(this).next(".msg").hide(),l=n(this),s=[];t.find(".ac-column[data-original=1]").each(function(){s.push(n(this).data("type"))}),e.addClass("loading"),n.ajax({url:ajaxurl,method:"post",dataType:"json",data:{action:"ac_column_select",type:c,current_original_columns:s,original_columns:AC.original_columns,list_screen:AC.list_screen,layout:AC.layout,_ajax_nonce:AC._ajax_nonce}}).done(function(t){if(t)if(t.success){var a=e.closest(".ac-column"),c=n("<div>"+t.data+"</div>").children();a.replaceWith(c),a=c,a.column_bind_toggle(),a.column_bind_remove(),a.column_bind_clone(),a.column_bind_events(),a.addClass("opened").find(".ac-column-body").show(),a.cpac_update_clone_id(),n(document).trigger("column_change",a)}else t.data&&"message"===t.data.type&&(o.html(t.data.error).show(),l.find("option").removeAttr("selected"),l.find('option[value="'+i+'"]').attr("selected","selected"))}).always(function(){e.removeClass("loading")})}),e.find(".ac-column-setting--label input").bind("keyup change",function(){var e=n(this).val();n(this).closest(".ac-column").find("td.column_label .inner > a.toggle").html(e)}),e.find(".ac-column-body .col-label .label").hover(function(){n(this).parents(".col-label").find("div.tooltip").show()},function(){n(this).parents(".col-label").find("div.tooltip").hide()}),e.find('select[data-label="update"]').change(function(){var t=e.find("input.ac-setting-input_label"),i=n(this).find("option:selected").text();t.val(i),t.trigger("change")}),e.find('[data-refresh="column"]').change(function(){e.cpac_column_refresh()}),n(document).trigger("init_settings",e)},n.fn.column_bind_settings=function(){var e=n(this);e.find(".ac-column-setting--image_size").cpac_column_setting_image_size(),e.find(".ac-column-setting--width").cpac_column_setting_width()},n.fn.column_remove=function(){n(this).addClass("deleting").animate({opacity:0,height:0},350,function(){n(this).remove()})},n.fn.column_clone=function(){var e=n(this),t=n(this).closest("ac-columns");if("1"===e.attr("data-original")){var i=AC.i18n.clone.replace("%s","<strong>"+e.find(".column_label .toggle").text()+"</strong>");return e.addClass("opened").find(".ac-column-body").slideDown(150),void e.find(".ac-setting-input_type").next(".msg").html(i).show()}var a=n(this).clone();return a.cpac_update_clone_id(),n(this).after(a),a.column_bind_toggle(),a.column_bind_remove(),a.column_bind_clone(),a.column_bind_events(),t.cpac_bind_ordering(),n(document).trigger("column_add",a),a},n.fn.cpac_update_clone_id=function(){var e=n(this),t=e.attr("data-column-name"),i="_new_column_"+incremental_column_name,a=e.find("input, select, label");n(a).each(function(e,a){n(a).attr("name")&&n(a).attr("name",n(a).attr("name").replace("columns["+t+"]","columns["+i+"]")),n(a).attr("id")&&n(a).attr("id",n(a).attr("id").replace("-"+t+"-","-"+i+"-"))}),e.attr("data-column-name",i),incremental_column_name++},n(document).bind("column_init column_change column_add",function(e,t){n(t).closest(".ac-boxes").hasClass("disabled")||(n(t).cpac_bind_column_addon_events(),n(t).cpac_bind_indicator_events())}),n.fn.cpac_bind_column_addon_events=function(){var e=n(this);e.find("[data-trigger] label").on("click",function(){var t=n(this).closest("td.input").data("trigger"),i=n("input",this).val(),a=e.find('[data-indicator-id="'+t+'"]').removeClass("on");"on"==i&&a.addClass("on");var c=e.find('[data-handle="'+t+'"]').addClass("hide");"on"==i&&c.removeClass("hide")}),e.find("[data-trigger]").each(function(){var t=n(this).data("trigger"),i=e.find('[data-handle="'+t+'"]').addClass("hide");"on"==n("input:checked",this).val()&&i.removeClass("hide")})},n.fn.cpac_bind_indicator_events=function(){var e=n(this);e.find(".ac-column-header [data-indicator-toggle]").each(function(){var t=n(this),i=n(this).data("setting"),a=e.find(".ac-column-setting[data-setting="+i+"]"),c=a.find(".col-input:first .ac-setting-input:first input[type=radio]");t.unbind("click").on("click",function(e){e.preventDefault(),t.toggleClass("on"),n(this).hasClass("on")?c.filter("[value=on]").prop("checked",!0).trigger("click").trigger("change"):c.filter("[value=off]").prop("checked",!0).trigger("click").trigger("change")}),c.on("change",function(){"on"==c.filter(":checked").val()?t.addClass("on"):t.removeClass("on")})})},n.fn.cpac_bind_ordering=function(){n(this).each(function(){n(this).hasClass("ui-sortable")?n(this).sortable("refresh"):n(this).sortable({items:".ac-column",handle:".column_sort"})})},n.fn.cpac_column_setting_image_size=function(){function e(n,e){"cpac-custom"==e.val()?n.find(".ac-column-setting").show():n.find(".ac-column-setting").hide()}n(this).each(function(){var t=n(this),i=n(this).find(".ac-setting-input select");e(t,i),i.on("change",function(){e(t,n(this))})})},n(document).on("init_settings",function(e,t){n(t).find(".ac-column-setting--image").cpac_column_setting_image_size(),n(t).find(".ac-column-setting--images").cpac_column_setting_image_size()}),n.fn.column_width_slider=function(){var e=n(this).find(".ac-setting-input-width"),t=e.find(".description input"),i=e.find(".unit-select input"),a=i.filter(":checked").val(),c=t.val(),o=e.find(".width-slider"),l=n(this).find(".ac-column-header .ac-column-heading-setting--width");"%"==a&&c>100&&(c=100),t.val(c),o.slider({range:"min",min:0,max:"%"==a?100:500,value:c,slide:function(n,e){t.val(e.value),l.trigger("update"),t.trigger("validate")}})},n.fn.cpac_column_setting_width=function(){n(this).each(function(){var e=n(this).parents(".ac-column");e.column_width_slider();var t=e.find(".ac-column-header .ac-column-heading-setting--width");t.on("update",function(){var t=e.find(".ac-setting-input-width .description input").val(),i=e.find(".ac-setting-input-width .description .unit").text();t>0?n(this).text(t+i):n(this).text("")}),e.find(".ac-setting-input-width .unit-select label").on("click",function(){e.find("span.unit").text(n(this).find("input").val()),e.column_width_slider(),t.trigger("update")});var i=e.find(".ac-setting-input-width .description input").on("keyup",function(){e.column_width_slider(),n(this).trigger("validate"),t.trigger("update")}).on("validate",function(){var e=i.val(),t=n.trim(e);n.isNumeric(t)||(t=t.replace(/\D/g,"")),t.length>3&&(t=t.substring(0,3)),t<=0&&(t=""),t!==e&&i.val(t)})})},n.fn.cpac_column_sub_setting_toggle=function(e){function t(n,e){var t=e.filter(":checked").val(),a=n.find(i.subfield);i.value_show==t?a.show():a.hide()}var i=n.extend({value_show:"on",subfield:".ac-column-setting"},e);n(this).each(function(){var e=n(this),i=n(this).find('.ac-setting-input input[type="radio"]');t(e,i),i.on("change",function(){t(e,i)})})},n.fn.cpac_column_setting_date=function(){n(this).each(function(){var e=n(this),t=e.find("input.custom"),i=e.find(".ac-setting-input-date__custom"),a=e.find(".ac-setting-input-date__value"),c=e.find(".ac-setting-input-date__example"),o=e.find("input[type=radio]:checked"),l=e.find(".help-msg");e.find("input[type=radio]").on("change",function(){var e=n(this),t=e.closest("label"),o=t.find("code").text(),s=t.find(".ac-setting-input-date__more").html();o&&i.val(o).trigger("change"),e.hasClass("diff")&&(i.val(""),c.text("")),i.prop("disabled",!0),e.hasClass("custom")&&(e.val(i.val()),i.prop("disabled",!1),l.show()),l.hide(),s&&l.html(s).show(),a.val(e.val())}),i.on("change",function(){c.html('<span class="spinner is-active"></span>'),t.val(i.val());var e=n(this).val();if(!e)return void c.text("");n.ajax({url:ajaxurl,method:"post",data:{action:"date_format",date:e}}).done(function(n){c.text(n)}),a.val(e)}),o.trigger("change"),0===o.length&&t.trigger("click")})},n(document).on("init_settings",function(e,t){n(t).find(".ac-column-setting--width").cpac_column_setting_width(),n(t).find(".ac-column-setting--date").cpac_column_setting_date(),n(t).find(".ac-column-setting--filter").cpac_column_sub_setting_toggle(),n(t).find(".ac-column-setting--sort").cpac_column_sub_setting_toggle(),n(t).find(".ac-column-setting--edit").cpac_column_sub_setting_toggle()})}(jQuery);
assets/js/table.js CHANGED
@@ -7,6 +7,7 @@ jQuery( document ).ready( function( $ ) {
7
ac_edit_button( $ );
8
ac_toggle_box( $ );
9
ac_toggle_box_ajax_init( $ );
10
11
$( '.wp-list-table' ).on( 'updated', 'tr', function() {
12
ac_set_column_classes( $ );
@@ -15,9 +16,27 @@ jQuery( document ).ready( function( $ ) {
15
} );
16
} );
17
18
function ac_edit_button( $ ) {
19
if ( AC.edit_link ) {
20
- $( '.tablenav.top .actions:last' ).append( '<a class="cpac-edit add-new-h2" href="' + AC.edit_link + '">' + AC.i18n.edit_columns + '</a>' );
21
}
22
}
23
7
ac_edit_button( $ );
8
ac_toggle_box( $ );
9
ac_toggle_box_ajax_init( $ );
10
+ ac_actions_tooltips( $ );
11
12
$( '.wp-list-table' ).on( 'updated', 'tr', function() {
13
ac_set_column_classes( $ );
16
} );
17
} );
18
19
+ function ac_actions_tooltips( $ ) {
20
+ $( '.row-actions a' ).qtip( {
21
+ content : {
22
+ text : function() {
23
+ return $( this ).text();
24
+ }
25
+ },
26
+ position : {
27
+ my : 'top center',
28
+ at : 'bottom center'
29
+ },
30
+ style : {
31
+ tip : true,
32
+ classes : 'qtip-tipsy'
33
+ }
34
+ } );
35
+ }
36
+
37
function ac_edit_button( $ ) {
38
if ( AC.edit_link ) {
39
+ $( '.tablenav.top .actions:last' ).append( '<a class="ac-button add-new-h2 ac-button-edit" href="' + AC.edit_link + '">' + AC.i18n.edit_columns + '</a>' );
40
}
41
}
42
assets/js/table.min.js CHANGED
@@ -1 +1 @@
1
- function ac_edit_button(t){AC.edit_link&&t(".tablenav.top .actions:last").append('<a class="cpac-edit add-new-h2" href="'+AC.edit_link+'">'+AC.i18n.edit_columns+"</a>")}function ac_toggle_box(t){t(".ac-toggle-box-link").click(function(a){a.preventDefault(),t(this).next(".ac-toggle-box-contents").toggle()})}function ac_toggle_box_ajax_init(t){var a=function(a){a.preventDefault(),t(this).next(".ac-toggle-box-contents-ajax").toggle()},n=function(c){c.preventDefault();var o=t(this),e={action:"ac_get_column_value",list_screen:AC.list_screen,layout:AC.layout,column:o.data("column"),pk:o.attr("data-item-id"),_ajax_nonce:AC.ajax_nonce};o.addClass("loading"),t.post(ajaxurl,e,function(c){c&&(o.after('<div class="ac-toggle-box-contents-ajax">'+c+"</div>"),o.unbind("click",n).bind("click",a),t(o.parent("td")).trigger("ajax_column_value_ready"),ac_tooltips(t))}).always(function(){o.removeClass("loading")})};t("a[data-ajax-populate=1]").bind("click",n)}function ac_show_more(t){t(".ac-more-link-show").click(function(a){a.preventDefault(),t(this).hide().closest("td").find(".ac-show-more-block").show()}),t(".ac-more-link-hide").click(function(a){a.preventDefault();var n=t(this).closest("td");n.find(".ac-more-link-show").show(),n.find(".ac-show-more-block").hide()})}function ac_actions_column(t,a){t(a).each(function(){var a=t(this);a.find(".cpac_use_icons").length>0&&a.addClass("cpac_use_icons")}),t(a).find(".cpac_use_icons + .hidden + .row-actions > span").each(function(){var a=t(this).find("a");a.attr("data-ac-tip",a.text()).addClass("ac-tip")})}function ac_set_column_classes(t){for(var a in AC.column_types)if(AC.column_types.hasOwnProperty(a)){var n=AC.column_types[a];t(".wp-list-table td."+a).addClass(n)}}function ac_tooltips(t){void 0!==t.fn.qtip&&t("[data-ac-tip]").qtip({content:{attr:"data-ac-tip"},position:{my:"top center",at:"bottom center"},style:{tip:!0,classes:"qtip-tipsy"}})}function ac_quickedit_events(t){t(document).ajaxComplete(function(a,n){var c=t("<div>").append(n.responseText);if(1===c.find("tr.iedit").length){var o=c.find("tr.iedit").attr("id");t("tr#"+o).trigger("updated")}})}jQuery(document).ready(function(t){ac_quickedit_events(t),ac_set_column_classes(t),ac_actions_column(t,t(".column-actions")),ac_tooltips(t),ac_show_more(t),ac_edit_button(t),ac_toggle_box(t),ac_toggle_box_ajax_init(t),t(".wp-list-table").on("updated","tr",function(){ac_set_column_classes(t),ac_actions_column(t,t(this).find(".column-actions")),ac_show_more(t)})});
1
+ function ac_actions_tooltips(t){t(".row-actions a").qtip({content:{text:function(){return t(this).text()}},position:{my:"top center",at:"bottom center"},style:{tip:!0,classes:"qtip-tipsy"}})}function ac_edit_button(t){AC.edit_link&&t(".tablenav.top .actions:last").append('<a class="ac-button add-new-h2 ac-button-edit" href="'+AC.edit_link+'">'+AC.i18n.edit_columns+"</a>")}function ac_toggle_box(t){t(".ac-toggle-box-link").click(function(a){a.preventDefault(),t(this).next(".ac-toggle-box-contents").toggle()})}function ac_toggle_box_ajax_init(t){var a=function(a){a.preventDefault(),t(this).next(".ac-toggle-box-contents-ajax").toggle()},n=function(o){o.preventDefault();var c=t(this),i={action:"ac_get_column_value",list_screen:AC.list_screen,layout:AC.layout,column:c.data("column"),pk:c.attr("data-item-id"),_ajax_nonce:AC.ajax_nonce};c.addClass("loading"),t.post(ajaxurl,i,function(o){o&&(c.after('<div class="ac-toggle-box-contents-ajax">'+o+"</div>"),c.unbind("click",n).bind("click",a),t(c.parent("td")).trigger("ajax_column_value_ready"),ac_tooltips(t))}).always(function(){c.removeClass("loading")})};t("a[data-ajax-populate=1]").bind("click",n)}function ac_show_more(t){t(".ac-more-link-show").click(function(a){a.preventDefault(),t(this).hide().closest("td").find(".ac-show-more-block").show()}),t(".ac-more-link-hide").click(function(a){a.preventDefault();var n=t(this).closest("td");n.find(".ac-more-link-show").show(),n.find(".ac-show-more-block").hide()})}function ac_actions_column(t,a){t(a).each(function(){var a=t(this);a.find(".cpac_use_icons").length>0&&a.addClass("cpac_use_icons")}),t(a).find(".cpac_use_icons + .hidden + .row-actions > span").each(function(){var a=t(this).find("a");a.attr("data-ac-tip",a.text()).addClass("ac-tip")})}function ac_set_column_classes(t){for(var a in AC.column_types)if(AC.column_types.hasOwnProperty(a)){var n=AC.column_types[a];t(".wp-list-table td."+a).addClass(n)}}function ac_tooltips(t){void 0!==t.fn.qtip&&t("[data-ac-tip]").qtip({content:{attr:"data-ac-tip"},position:{my:"top center",at:"bottom center"},style:{tip:!0,classes:"qtip-tipsy"}})}function ac_quickedit_events(t){t(document).ajaxComplete(function(a,n){var o=t("<div>").append(n.responseText);if(1===o.find("tr.iedit").length){var c=o.find("tr.iedit").attr("id");t("tr#"+c).trigger("updated")}})}jQuery(document).ready(function(t){ac_quickedit_events(t),ac_set_column_classes(t),ac_actions_column(t,t(".column-actions")),ac_tooltips(t),ac_show_more(t),ac_edit_button(t),ac_toggle_box(t),ac_toggle_box_ajax_init(t),ac_actions_tooltips(t),t(".wp-list-table").on("updated","tr",function(){ac_set_column_classes(t),ac_actions_column(t,t(this).find(".column-actions")),ac_show_more(t)})});
classes/API.php CHANGED
@@ -20,9 +20,13 @@ class AC_API {
20
* @param AC_ListScreen $list_screen
21
*/
22
public function set_column_settings( AC_ListScreen $list_screen ) {
23
- if ( $settings = $this->get_column_settings( $list_screen ) ) {
24
- $list_screen->set_settings( $settings )->set_read_only( true );
25
}
26
}
27
28
/**
@@ -31,11 +35,15 @@ class AC_API {
31
* @return array|false
32
*/
33
public function get_column_settings( AC_ListScreen $list_screen ) {
34
- if ( $columndata = $this->get_columndata( $list_screen->get_key() ) ) {
35
- foreach ( $columndata as $data ) {
36
- if ( $list_screen->get_storage_key() === $list_screen->get_key() . $data['layout']['id'] ) {
37
- return $data['columns'];
38
- }
39
}
40
}
41
@@ -48,11 +56,16 @@ class AC_API {
48
* @return array
49
*/
50
public function get_layouts_settings( $list_screen ) {
51
$layouts = array();
52
- if ( $columndata = $this->get_columndata( $list_screen->get_key() ) ) {
53
- foreach ( $columndata as $data ) {
54
- $layouts[] = $data['layout'];
55
- }
56
}
57
58
return $layouts;
20
* @param AC_ListScreen $list_screen
21
*/
22
public function set_column_settings( AC_ListScreen $list_screen ) {
23
+ $settings = $this->get_column_settings( $list_screen );
24
+
25
+ if ( ! $settings ) {
26
+ return;
27
}
28
+
29
+ $list_screen->set_settings( $settings )->set_read_only( true );
30
}
31
32
/**
35
* @return array|false
36
*/
37
public function get_column_settings( AC_ListScreen $list_screen ) {
38
+ $columndata = $this->get_columndata( $list_screen->get_key() );
39
+
40
+ if ( ! $columndata ) {
41
+ return false;
42
+ }
43
+
44
+ foreach ( $columndata as $data ) {
45
+ if ( $list_screen->get_storage_key() === $list_screen->get_key() . $data['layout']['id'] ) {
46
+ return $data['columns'];
47
}
48
}
49
56
* @return array
57
*/
58
public function get_layouts_settings( $list_screen ) {
59
+ $columndata = $this->get_columndata( $list_screen->get_key() );
60
+
61
+ if ( ! $columndata ) {
62
+ return array();
63
+
64
+ }
65
+
66
$layouts = array();
67
+ foreach ( $columndata as $data ) {
68
+ $layouts[] = $data['layout'];
69
}
70
71
return $layouts;
classes/Addon/BuddyPress.php CHANGED
@@ -13,7 +13,7 @@ class AC_Addon_BuddyPress extends AC_Addon {
13
->set_title( __( 'BuddyPress', 'codepress-admin-columns' ) )
14
->set_logo( AC()->get_plugin_url() . 'assets/images/addons/buddypress.png' )
15
->set_icon( AC()->get_plugin_url() . 'assets/images/addons/buddypress-icon.png' )
16
- ->set_link( ac_get_site_utm_url( 'buddypress-columns', 'addon', 'buddypress' ) )
17
->set_description( __( 'Display any of your Profile Fields for BuddyPress on your users overview.', 'codepress-admin-columns' ) )
18
->add_plugin( 'buddypress' );
19
}
13
->set_title( __( 'BuddyPress', 'codepress-admin-columns' ) )
14
->set_logo( AC()->get_plugin_url() . 'assets/images/addons/buddypress.png' )
15
->set_icon( AC()->get_plugin_url() . 'assets/images/addons/buddypress-icon.png' )
16
+ ->set_link( ac_get_site_utm_url( 'buddypress', 'addon', 'buddypress' ) )
17
->set_description( __( 'Display any of your Profile Fields for BuddyPress on your users overview.', 'codepress-admin-columns' ) )
18
->add_plugin( 'buddypress' );
19
}
classes/Addon/EventsCalendar.php ADDED
@@ -0,0 +1,38 @@
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ class AC_Addon_EventsCalendar extends AC_Addon {
8
+
9
+ public function __construct() {
10
+ parent::__construct( 'ac-addon-events-calendar' );
11
+
12
+ $this
13
+ ->set_title( __( 'The Events Calendar', 'codepress-admin-columns' ) )
14
+ ->set_logo( AC()->get_plugin_url() . 'assets/images/addons/events-calendar.png' )
15
+ ->set_icon( AC()->get_plugin_url() . 'assets/images/addons/events-calendar-icon.png' )
16
+ ->set_link( ac_get_site_utm_url( 'events-calendar', 'addon', 'events-calendar' ) )
17
+ ->set_description( "Manage columns for your event, organizer or venue overviews." )
18
+ ->add_plugin( 'events-calendar' );
19
+ }
20
+
21
+ public function display_promo() {
22
+ echo $this->get_title() . ' ';
23
+ $this->display_icon();
24
+ }
25
+
26
+ public function show_missing_notice_on_current_page() {
27
+ global $pagenow;
28
+
29
+ $is_page = 'edit.php' === $pagenow && in_array( filter_input( INPUT_GET, 'post_type' ), array( 'tribe_events', 'tribe_venue', 'tribe_organizer' ) );
30
+
31
+ return parent::show_missing_notice_on_current_page() || $is_page;
32
+ }
33
+
34
+ public function is_plugin_active() {
35
+ return class_exists( 'Tribe__Events__Main' );
36
+ }
37
+
38
+ }
classes/Addon/NinjaForms.php ADDED
@@ -0,0 +1,38 @@
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ class AC_Addon_NinjaForms extends AC_Addon {
8
+
9
+ public function __construct() {
10
+ parent::__construct( 'ac-addon-ninjaforms' );
11
+
12
+ $this
13
+ ->set_title( __( 'Ninja Forms', 'codepress-admin-columns' ) )
14
+ ->set_logo( AC()->get_plugin_url() . 'assets/images/addons/ninja-forms.png' )
15
+ ->set_icon( AC()->get_plugin_url() . 'assets/images/addons/ninja-forms-icon.png' )
16
+ ->set_link( ac_get_site_utm_url( 'ninja-forms', 'addon', 'ninjaforms' ) )
17
+ ->set_description( "Add Ninja Forms columns that can be sorted, filtered and directly edited!" )
18
+ ->add_plugin( 'ninjaforms' );
19
+ }
20
+
21
+ public function display_promo() {
22
+ echo $this->get_title() . ' ';
23
+ $this->display_icon();
24
+ }
25
+
26
+ public function show_missing_notice_on_current_page() {
27
+ global $pagenow;
28
+
29
+ $is_page = 'admin.php' === $pagenow && in_array( filter_input( INPUT_GET, 'page' ), array( 'bp-activity', 'bp-groups' ) );
30
+
31
+ return parent::show_missing_notice_on_current_page() || $is_page;
32
+ }
33
+
34
+ public function is_plugin_active() {
35
+ return class_exists( 'Ninja_Forms' );
36
+ }
37
+
38
+ }
classes/Addon/Pods.php CHANGED
@@ -13,7 +13,7 @@ class AC_Addon_Pods extends AC_Addon {
13
->set_title( __( 'Pods', 'codepress-admin-columns' ) )
14
->set_logo( AC()->get_plugin_url() . 'assets/images/addons/pods.png' )
15
->set_icon( AC()->get_plugin_url() . 'assets/images/addons/pods-icon.png' )
16
- ->set_link( ac_get_site_utm_url( 'pods-columns', 'addon', 'pods' ) )
17
->set_description( $this->get_fields_description( $this->get_title() ) )
18
->add_plugin( 'pods' );
19
}
13
->set_title( __( 'Pods', 'codepress-admin-columns' ) )
14
->set_logo( AC()->get_plugin_url() . 'assets/images/addons/pods.png' )
15
->set_icon( AC()->get_plugin_url() . 'assets/images/addons/pods-icon.png' )
16
+ ->set_link( ac_get_site_utm_url( 'pods', 'addon', 'pods' ) )
17
->set_description( $this->get_fields_description( $this->get_title() ) )
18
->add_plugin( 'pods' );
19
}
classes/Addon/Types.php CHANGED
@@ -13,7 +13,7 @@ class AC_Addon_Types extends AC_Addon {
13
->set_title( __( 'Toolset Types', 'codepress-admin-columns' ) )
14
->set_logo( AC()->get_plugin_url() . 'assets/images/addons/toolset-types.png' )
15
->set_icon( AC()->get_plugin_url() . 'assets/images/addons/toolset-types-icon.png' )
16
- ->set_link( ac_get_site_utm_url( 'toolset-types-columns', 'addon', 'types' ) )
17
->set_description( $this->get_fields_description( $this->get_title() ) )
18
->add_plugin( 'types' );
19
}
13
->set_title( __( 'Toolset Types', 'codepress-admin-columns' ) )
14
->set_logo( AC()->get_plugin_url() . 'assets/images/addons/toolset-types.png' )
15
->set_icon( AC()->get_plugin_url() . 'assets/images/addons/toolset-types-icon.png' )
16
+ ->set_link( ac_get_site_utm_url( 'toolset-types', 'addon', 'types' ) )
17
->set_description( $this->get_fields_description( $this->get_title() ) )
18
->add_plugin( 'types' );
19
}
classes/Admin/Page/Addons.php CHANGED
@@ -6,13 +6,6 @@ if ( ! defined( 'ABSPATH' ) ) {
6
7
class AC_Admin_Page_Addons extends AC_Admin_Page {
8
9
- /**
10
- * User meta key for hiding "Install addons" notice
11
- *
12
- * @since 2.4.9
13
- */
14
- const OPTION_ADMIN_NOTICE_INSTALL_ADDONS_KEY = 'cpac-hide-install-addons-notice';
15
-
16
public function __construct() {
17
$this
18
->set_slug( 'addons' )
@@ -117,7 +110,7 @@ class AC_Admin_Page_Addons extends AC_Admin_Page {
117
if ( $plugin->is_active() ) {
118
AC()->notice( sprintf( $activate_string, '<strong>' . $plugin->get_name() . '</strong>' ) );
119
} else {
120
- AC()->notice( sprintf( __( '%s could not be activated.', 'codepress-admin-columns' ), '<strong>' . $plugin->get_name() . '</strong>' ) . ' ' . sprintf( 'Please visit the %s page.', ac_helper()->html->link( admin_url( 'plugins.php' ), strtolower( __( 'Plugins' ) ) ) ), 'error' );
121
}
122
break;
123
case 'deactivate' :
@@ -130,9 +123,9 @@ class AC_Admin_Page_Addons extends AC_Admin_Page {
130
* Admin scripts
131
*/
132
public function admin_scripts() {
133
- if ( $this->is_current_screen() ) {
134
- wp_enqueue_style( 'ac-admin-page-addons', AC()->get_plugin_url() . 'assets/css/admin-page-addons' . AC()->minified() . '.css', array(), AC()->get_version() );
135
- }
136
}
137
138
/**
@@ -157,7 +150,7 @@ class AC_Admin_Page_Addons extends AC_Admin_Page {
157
return;
158
}
159
160
- if ( ac_helper()->user->get_meta_site( self::OPTION_ADMIN_NOTICE_INSTALL_ADDONS_KEY, true ) ) {
161
return;
162
}
163
@@ -177,11 +170,11 @@ class AC_Admin_Page_Addons extends AC_Admin_Page {
177
$plugins_list = ac_helper()->string->enumeration_list( $plugins, 'and' );
178
179
?>
180
- <div class="ac-message updated">
181
- <a href="#" class="hide-notice hide-install-addons-notice"></a>
182
183
- <p><?php printf( __( "Did you know Admin Columns Pro has an integration addon for %s? With the proper Admin Columns Pro license, you can download them from %s!", 'codepress-admin-columns' ), $plugins_list, ac_helper()->html->link( $this->get_link(), __( 'the addons page', 'codepress-admin-columns' ) ) ); ?>
184
- </div>
185
<?php
186
187
wp_enqueue_script( 'ac-sitewide-notices' );
@@ -189,13 +182,20 @@ class AC_Admin_Page_Addons extends AC_Admin_Page {
189
}
190
}
191
192
/**
193
* Ajax callback for hiding the "Missing addons" notice used for notifying users of available integration addons for plugins they have installed
194
*
195
* @since 2.4.9
196
*/
197
public function ajax_hide_install_addons_notice() {
198
- ac_helper()->user->update_meta_site( self::OPTION_ADMIN_NOTICE_INSTALL_ADDONS_KEY, '1', true );
199
}
200
201
/**
@@ -373,28 +373,28 @@ class AC_Admin_Page_Addons extends AC_Admin_Page {
373
public function display() {
374
375
foreach ( $this->get_grouped_addons() as $group_slug => $group ) : ?>
376
- <div class="ac-addon group-<?php echo esc_attr( $group_slug ); ?>">
377
- <h2><?php echo esc_html( $group['title'] ); ?></h2>
378
379
- <ul>
380
<?php
381
foreach ( $group['addons'] as $addon ) :
382
/* @var AC_Addon $addon */ ?>
383
- <li class="<?php echo esc_attr( $addon->get_slug() ); ?>">
384
- <div class="addon-header">
385
- <div class="inner">
386
<?php if ( $addon->get_logo() ) : ?>
387
- <img src="<?php echo esc_attr( $addon->get_logo() ); ?>"/>
388
<?php else : ?>
389
- <h2><?php echo esc_html( $addon->get_title() ); ?></h2>
390
<?php endif; ?>
391
- </div>
392
- </div>
393
- <div class="addon-content">
394
- <h3><?php echo esc_html( $addon->get_title() ); ?></h3>
395
- <p><?php echo esc_html( $addon->get_description() ); ?></p>
396
- </div>
397
- <div class="addon-actions">
398
<?php
399
400
// Installed..
@@ -402,30 +402,30 @@ class AC_Admin_Page_Addons extends AC_Admin_Page {
402
403
// Active
404
if ( $addon->is_active() ) : ?>
405
- <span class="active"><?php _e( 'Active', 'codepress-admin-columns' ); ?></span>
406
407
<?php if ( current_user_can( 'activate_plugins' ) ) : ?>
408
- <a href="<?php echo esc_url( $addon->get_deactivation_url( $addon->get_basename() ) ); ?>" class="button right"><?php _e( 'Deactivate', 'codepress-admin-columns' ); ?></a>
409
<?php endif;
410
// Installed
411
- elseif ( current_user_can( 'activate_plugins' ) ) : ?>
412
- <a href="<?php echo esc_url( $addon->get_activation_url( $addon->get_basename() ) ); ?>" class="button button-primary right"><?php _e( 'Activate', 'codepress-admin-columns' ); ?></a>
413
<?php endif;
414
415
// Not installed...
416
else :
417
if ( ac_is_pro_active() && current_user_can( 'install_plugins' ) ) : ?>
418
- <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'install', 'plugin' => $addon->get_slug() ), $this->get_link() ), 'install-ac-addon' ) ); ?>" class="button"><?php esc_html_e( 'Download & Install', 'codepress-admin-columns' ); ?></a>
419
<?php else : ?>
420
- <a target="_blank" href="<?php echo esc_url( $addon->get_link() ); ?>" class="button"><?php esc_html_e( 'Get this add-on', 'codepress-admin-columns' ); ?></a>
421
<?php endif;
422
endif;
423
?>
424
- </div>
425
- </li>
426
<?php endforeach; // addons ?>
427
- </ul>
428
- </div>
429
<?php endforeach; // grouped_addons
430
}
431
6
7
class AC_Admin_Page_Addons extends AC_Admin_Page {
8
9
public function __construct() {
10
$this
11
->set_slug( 'addons' )
110
if ( $plugin->is_active() ) {
111
AC()->notice( sprintf( $activate_string, '<strong>' . $plugin->get_name() . '</strong>' ) );
112
} else {
113
+ AC()->notice( sprintf( __( '%s could not be activated.', 'codepress-admin-columns' ), '<strong>' . $plugin->get_name() . '</strong>' ) . ' ' . sprintf( __( 'Please visit the %s page.', 'codepress-admin-columns' ), ac_helper()->html->link( admin_url( 'plugins.php' ), strtolower( __( 'Plugins' ) ) ) ), 'error' );
114
}
115
break;
116
case 'deactivate' :
123
* Admin scripts
124
*/
125
public function admin_scripts() {
126
+ if ( $this->is_current_screen() ) {
127
+ wp_enqueue_style( 'ac-admin-page-addons', AC()->get_plugin_url() . 'assets/css/admin-page-addons' . AC()->minified() . '.css', array(), AC()->get_version() );
128
+ }
129
}
130
131
/**
150
return;
151
}
152
153
+ if ( $this->hide_notice() ) {
154
return;
155
}
156
170
$plugins_list = ac_helper()->string->enumeration_list( $plugins, 'and' );
171
172
?>
173
+ <div class="ac-message updated">
174
+ <a href="#" class="hide-notice hide-install-addons-notice"></a>
175
176
+ <p><?php printf( __( "Did you know Admin Columns Pro has an integration addon for %s? With the proper Admin Columns Pro license, you can download them from %s!", 'codepress-admin-columns' ), $plugins_list, ac_helper()->html->link( $this->get_link(), __( 'the addons page', 'codepress-admin-columns' ) ) ); ?>
177
+ </div>
178
<?php
179
180
wp_enqueue_script( 'ac-sitewide-notices' );
182
}
183
}
184
185
+ /**
186
+ * @return bool
187
+ */
188
+ private function hide_notice() {
189
+ return (bool) get_user_meta( get_current_user_id(), 'ac_hide_notice_addons', true );
190
+ }
191
+
192
/**
193
* Ajax callback for hiding the "Missing addons" notice used for notifying users of available integration addons for plugins they have installed
194
*
195
* @since 2.4.9
196
*/
197
public function ajax_hide_install_addons_notice() {
198
+ update_user_meta( get_current_user_id(), 'ac_hide_notice_addons', true );
199
}
200
201
/**
373
public function display() {
374
375
foreach ( $this->get_grouped_addons() as $group_slug => $group ) : ?>
376
+ <div class="ac-addon group-<?php echo esc_attr( $group_slug ); ?>">
377
+ <h2><?php echo esc_html( $group['title'] ); ?></h2>
378
379
+ <ul>
380
<?php
381
foreach ( $group['addons'] as $addon ) :
382
/* @var AC_Addon $addon */ ?>
383
+ <li class="<?php echo esc_attr( $addon->get_slug() ); ?>">
384
+ <div class="addon-header">
385
+ <div class="inner">
386
<?php if ( $addon->get_logo() ) : ?>
387
+ <img src="<?php echo esc_attr( $addon->get_logo() ); ?>"/>
388
<?php else : ?>
389
+ <h2><?php echo esc_html( $addon->get_title() ); ?></h2>
390
<?php endif; ?>
391
+ </div>
392
+ </div>
393
+ <div class="addon-content">
394
+ <h3><?php echo esc_html( $addon->get_title() ); ?></h3>
395
+ <p><?php echo esc_html( $addon->get_description() ); ?></p>
396
+ </div>
397
+ <div class="addon-actions">
398
<?php
399
400
// Installed..
402
403
// Active
404
if ( $addon->is_active() ) : ?>
405
+ <span class="active"><?php _e( 'Active', 'codepress-admin-columns' ); ?></span>
406
407
<?php if ( current_user_can( 'activate_plugins' ) ) : ?>
408
+ <a href="<?php echo esc_url( $addon->get_deactivation_url( $addon->get_basename() ) ); ?>" class="button right"><?php _e( 'Deactivate', 'codepress-admin-columns' ); ?></a>
409
<?php endif;
410
// Installed
411
+ elseif ( current_user_can( 'activate_plugins' ) ) : ?>
412
+ <a href="<?php echo esc_url( $addon->get_activation_url( $addon->get_basename() ) ); ?>" class="button button-primary right"><?php _e( 'Activate', 'codepress-admin-columns' ); ?></a>
413
<?php endif;
414
415
// Not installed...
416
else :
417
if ( ac_is_pro_active() && current_user_can( 'install_plugins' ) ) : ?>
418
+ <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'install', 'plugin' => $addon->get_slug() ), $this->get_link() ), 'install-ac-addon' ) ); ?>" class="button"><?php esc_html_e( 'Download & Install', 'codepress-admin-columns' ); ?></a>
419
<?php else : ?>
420
+ <a target="_blank" href="<?php echo esc_url( $addon->get_link() ); ?>" class="button"><?php esc_html_e( 'Get this add-on', 'codepress-admin-columns' ); ?></a>
421
<?php endif;
422
endif;
423
?>
424
+ </div>
425
+ </li>
426
<?php endforeach; // addons ?>
427
+ </ul>
428
+ </div>
429
<?php endforeach; // grouped_addons
430
}
431
classes/Admin/Page/Columns.php CHANGED
@@ -6,8 +6,6 @@ if ( ! defined( 'ABSPATH' ) ) {
6
7
class AC_Admin_Page_Columns extends AC_Admin_Page {
8
9
- const OPTION_CURRENT = 'cpac_current_model';
10
-
11
/**
12
* @var array
13
*/
@@ -78,14 +76,6 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
78
do_action( 'ac/settings/scripts' );
79
}
80
81
- public function set_layout_preference( $layout ) {
82
- ac_helper()->user->update_meta_site( self::OPTION_CURRENT . '_layout', $layout );
83
- }
84
-
85
- public function get_layout_preference() {
86
- return ac_helper()->user->get_meta_site( self::OPTION_CURRENT . '_layout', true );
87
- }
88
-
89
private function get_first_list_screen() {
90
$list_screens = AC()->get_list_screens();
91
@@ -102,7 +92,7 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
102
103
// Preference
104
if ( ! $key ) {
105
- $key = $this->get_list_screen_preference();
106
}
107
108
// First one
@@ -125,7 +115,7 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
125
$this->set_original_table_headers( $list_screen );
126
}
127
128
- $this->set_list_screen_preference( $list_screen->get_key() );
129
130
$this->current_list_screen = $list_screen;
131
@@ -339,7 +329,7 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
339
if ( 'same-settings' === $result->get_error_code() ) {
340
wp_send_json_error( array(
341
'type' => 'notice notice-warning',
342
- 'message' => sprintf( __( 'You are trying to store the same settings for %s.', 'codepress-admin-columns' ), "<strong>" . $this->get_list_screen_message_label( $list_screen ) . "</strong>" ) . ' ' . $view_link
343
)
344
);
345
}
@@ -399,12 +389,8 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
399
return $grouped;
400
}
401
402
- private function set_list_screen_preference( $list_screen_key ) {
403
- ac_helper()->user->update_meta_site( self::OPTION_CURRENT, $list_screen_key );
404
- }
405
-
406
- private function get_list_screen_preference() {
407
- return ac_helper()->user->get_meta_site( self::OPTION_CURRENT, true );
408
}
409
410
/**
@@ -439,6 +425,20 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
439
return false;
440
}
441
442
/**
443
* @param AC_ListScreen $list_screen
444
*
@@ -570,7 +570,7 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
570
<?php endif; ?>
571
572
<p class="center">
573
- <?php echo ac_helper()->html->link( ac_get_site_utm_url( 'upgrade-to-admin-columns-pro', 'banner' ), sprintf( __( 'Prices starting from %s', 'codepress-admin-columns' ), '$39.20' ), array( 'class' => 'ac-pro-prices' ) ); ?> <sup>$49</sup>
574
</p>
575
<p class="center nopadding">
576
<?php if ( ! $active_promotion ) : ?>
@@ -592,11 +592,11 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
592
593
<div class="padding-box ac-pro-newsletter">
594
<h3>
595
- <?php echo esc_html( sprintf( __( 'Get %s Off!', 'codepress-admin-columns' ), '20%' ) ); ?>
596
</h3>
597
<div class="inside">
598
<p>
599
- <?php echo esc_html( sprintf( __( "Submit your email and we'll send you a discount for %s off.", 'codepress-admin-columns' ), '20%' ) ); ?>
600
</p>
601
<?php
602
$user_data = get_userdata( get_current_user_id() );
6
7
class AC_Admin_Page_Columns extends AC_Admin_Page {
8
9
/**
10
* @var array
11
*/
76
do_action( 'ac/settings/scripts' );
77
}
78
79
private function get_first_list_screen() {
80
$list_screens = AC()->get_list_screens();
81
92
93
// Preference
94
if ( ! $key ) {
95
+ $key = $this->preferences()->get( 'list_screen' );
96
}
97
98
// First one
115
$this->set_original_table_headers( $list_screen );
116
}
117
118
+ $this->preferences()->set( 'list_screen', $list_screen->get_key() );
119
120
$this->current_list_screen = $list_screen;
121
329
if ( 'same-settings' === $result->get_error_code() ) {
330
wp_send_json_error( array(
331
'type' => 'notice notice-warning',
332
+ 'message' => sprintf( __( 'You are trying to store the same settings for %s.', 'codepress-admin-columns' ), "<strong>" . $this->get_list_screen_message_label( $list_screen ) . "</strong>" ) . ' ' . $view_link,
333
)
334
);
335
}
389
return $grouped;
390
}
391
392
+ private function preferences() {
393
+ return new AC_Preferences( 'settings' );
394
}
395
396
/**
425
return false;
426
}
427
428
+ /**
429
+ * @return int
430
+ */
431
+ private function get_discount_percentage() {
432
+ return 10;
433
+ }
434
+
435
+ /**
436
+ * @return int
437
+ */
438
+ private function get_lowest_pro_price() {
439
+ return 49;
440
+ }
441
+
442
/**
443
* @param AC_ListScreen $list_screen
444
*
570
<?php endif; ?>
571
572
<p class="center">
573
+ <?php echo ac_helper()->html->link( ac_get_site_utm_url( 'upgrade-to-admin-columns-pro', 'banner' ), sprintf( __( 'Prices starting from %s', 'codepress-admin-columns' ), '#x27; . $this->get_lowest_pro_price() ), array( 'class' => 'ac-pro-prices' ) ); ?>
574
</p>
575
<p class="center nopadding">
576
<?php if ( ! $active_promotion ) : ?>
592
593
<div class="padding-box ac-pro-newsletter">
594
<h3>
595
+ <?php echo esc_html( sprintf( __( 'Get %s Off!', 'codepress-admin-columns' ), $this->get_discount_percentage() . '%' ) ); ?>
596
</h3>
597
<div class="inside">
598
<p>
599
+ <?php echo esc_html( sprintf( __( "Submit your email and we'll send you a discount for %s off.", 'codepress-admin-columns' ), $this->get_discount_percentage() . '%' ) ); ?>
600
</p>
601
<?php
602
$user_data = get_userdata( get_current_user_id() );
classes/Collection.php CHANGED
@@ -73,6 +73,10 @@ class AC_Collection
73
return ( $key !== null && $key !== false );
74
}
75
76
/**
77
* Filter collection items
78
*
@@ -82,6 +86,23 @@ class AC_Collection
82
return new AC_Collection( ac_helper()->array->filter( $this->items ) );
83
}
84
85
/**
86
* @param string $glue
87
*
73
return ( $key !== null && $key !== false );
74
}
75
76
+ public function count() {
77
+ return count( $this->items );
78
+ }
79
+
80
/**
81
* Filter collection items
82
*
86
return new AC_Collection( ac_helper()->array->filter( $this->items ) );
87
}
88
89
+ /**
90
+ * Limit array to max number of items
91
+ *
92
+ * @param int $length
93
+ *
94
+ * @return int Number of removed items
95
+ */
96
+ public function limit( $length ) {
97
+ $count = $this->count();
98
+
99
+ if ( 0 < $length ) {
100
+ $this->items = array_slice( $this->items, 0, $length );
101
+ }
102
+
103
+ return $count - $this->count();
104
+ }
105
+
106
/**
107
* @param string $glue
108
*
classes/Column.php CHANGED
@@ -49,6 +49,11 @@ class AC_Column {
49
*/
50
protected $list_screen;
51
52
/**
53
* The options managed by the settings
54
*
@@ -56,11 +61,6 @@ class AC_Column {
56
*/
57
protected $options = array();
58
59
- /**
60
- * @var string|bool
61
- */
62
- private $empty_char;
63
-
64
/**
65
* Get the unique name of the column
66
*
@@ -121,6 +121,20 @@ class AC_Column {
121
return $this;
122
}
123
124
/**
125
* Get the type of the column.
126
*
@@ -351,7 +365,7 @@ class AC_Column {
351
*/
352
public function get_formatted_value( $value, $original_value = null, $current = 0 ) {
353
$formatters = $this->get_formatters();
354
- $available = count( $formatters );
355
356
if ( null === $original_value ) {
357
$original_value = $value;
@@ -426,21 +440,10 @@ class AC_Column {
426
}
427
428
/**
429
- * @param string
430
- */
431
- public function set_empty_char( $char ) {
432
- $this->empty_char = (string) $char;
433
- }
434
-
435
- /**
436
- * @return bool|string
437
*/
438
public function get_empty_char() {
439
- if ( null === $this->empty_char ) {
440
- $this->set_empty_char( '&ndash;' );
441
- }
442
-
443
- return apply_filters( 'ac/empty_char', $this->empty_char, $this );
444
}
445
446
}
49
*/
50
protected $list_screen;
51
52
+ /**
53
+ * @var AC_Container
54
+ */
55
+ private $services;
56
+
57
/**
58
* The options managed by the settings
59
*
61
*/
62
protected $options = array();
63
64
/**
65
* Get the unique name of the column
66
*
121
return $this;
122
}
123
124
+ /**
125
+ * Container to inject and get services for this column
126
+ *
127
+ * @since 3.0.5
128
+ * @return AC_Container
129
+ */
130
+ public function services() {
131
+ if ( null === $this->services ) {
132
+ $this->services = new AC_Container();
133
+ }
134
+
135
+ return $this->services;
136
+ }
137
+
138
/**
139
* Get the type of the column.
140
*
365
*/
366
public function get_formatted_value( $value, $original_value = null, $current = 0 ) {
367
$formatters = $this->get_formatters();
368
+ $available = count( (array) $formatters );
369
370
if ( null === $original_value ) {
371
$original_value = $value;
440
}
441
442
/**
443
+ * @return string
444
*/
445
public function get_empty_char() {
446
+ return '&ndash;';
447
}
448
449
}
classes/Column/ActionColumnHelper.php DELETED
@@ -1,78 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * Holds all the row actions buttons for each content type (e.g. post, comment, user and media).
9
- * WP_List_Table does not have a method for retrieving row actions. This class uses their filters to fetch the actions.
10
- * For example usage see the AC_Column_Actions class.
11
- *
12
- * Class AC_Column_ActionColumnHelper
13
- */
14
- class AC_Column_ActionColumnHelper {
15
-
16
- private $actions;
17
-
18
- /**
19
- * @since 2.5
20
- */
21
- private static $_instance = null;
22
-
23
- /**
24
- * @since 2.5
25
- */
26
- public static function instance() {
27
- if ( null === self::$_instance ) {
28
- self::$_instance = new self();
29
- }
30
-
31
- return self::$_instance;
32
- }
33
-
34
- private function __construct() {
35
- add_filter( 'comment_row_actions', array( $this, 'set_comment' ), 10, 2 );
36
- add_filter( 'page_row_actions', array( $this, 'set_post' ), 10, 2 );
37
- add_filter( 'post_row_actions', array( $this, 'set_post' ), 10, 2 );
38
- add_filter( 'media_row_actions', array( $this, 'set_media' ), 10, 2 );
39
- add_filter( 'user_row_actions', array( $this, 'set_user' ), 10, 2 );
40
- }
41
-
42
- public function set_comment( $actions, $comment ) {
43
- $this->actions[ 'comment' ][ $comment->ID ] = $actions;
44
-
45
- return $actions;
46
- }
47
-
48
- public function set_post( $actions, $post ) {
49
- $this->actions[ 'post' ][ $post->ID ] = $actions;
50
-
51
- return $actions;
52
- }
53
-
54
- public function set_media( $actions, $post ) {
55
- $this->actions[ 'media' ][ $post->ID ] = $actions;
56
-
57
- return $actions;
58
- }
59
-
60
- public function set_user( $actions, $user ) {
61
- $this->actions[ 'user' ][ $user->ID ] = $actions;
62
-
63
- return $actions;
64
- }
65
-
66
- /**
67
- * Retrieve row actions like 'edit, trash, spam' etc.
68
- *
69
- * @param string $type
70
- * @param int $id Object ID
71
- *
72
- * @return array|false Array with actions
73
- */
74
- public function get( $type, $id ) {
75
- return isset( $this->actions[ $type ][ $id ] ) ? $this->actions[ $type ][ $id ] : array();
76
- }
77
-
78
- }
classes/Column/Actions.php CHANGED
@@ -9,18 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
9
*
10
* @since 2.2.6
11
*/
12
- abstract class AC_Column_Actions extends AC_Column {
13
-
14
- /**
15
- * Get a list of action links for an item (e.g. post) ID.
16
- *
17
- * @since 2.2.6
18
- *
19
- * @param int $id Item ID to get the list of actions for.
20
- *
21
- * @return array List of actions ([action name] => [action link]).
22
- */
23
- abstract protected function get_object_type();
24
25
/**
26
* @since 2.2.6
9
*
10
* @since 2.2.6
11
*/
12
+ class AC_Column_Actions extends AC_Column {
13
14
/**
15
* @since 2.2.6
classes/Column/Comment/Actions.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * @since 2.0
9
- */
10
- class AC_Column_Comment_Actions extends AC_Column_Actions {
11
-
12
- protected function get_object_type() {
13
- return 'comment';
14
- }
15
-
16
- }
classes/Column/Comment/DateGmt.php CHANGED
@@ -17,7 +17,7 @@ class AC_Column_Comment_DateGmt extends AC_Column {
17
public function get_value( $id ) {
18
$date_gmt = $this->get_raw_value( $id );
19
20
- $value = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ),
21
esc_url( get_comment_link( $id ) ),
22
ac_helper()->date->date( $date_gmt ),
23
ac_helper()->date->time( $date_gmt )
17
public function get_value( $id ) {
18
$date_gmt = $this->get_raw_value( $id );
19
20
+ $value = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>', 'codepress-admin-columns' ),
21
esc_url( get_comment_link( $id ) ),
22
ac_helper()->date->date( $date_gmt ),
23
ac_helper()->date->time( $date_gmt )
classes/Column/Comment/WordCount.php CHANGED
@@ -14,7 +14,7 @@ class AC_Column_Comment_WordCount extends AC_Column {
14
$this->set_label( __( 'Word Count', 'codepress-admin-columns' ) );
15
}
16
17
- public function get_raw_value( $post_id ) {
18
$comment = get_comment( $id );
19
20
return ac_helper()->string->word_count( $comment->comment_content );
14
$this->set_label( __( 'Word Count', 'codepress-admin-columns' ) );
15
}
16
17
+ public function get_raw_value( $id ) {
18
$comment = get_comment( $id );
19
20
return ac_helper()->string->word_count( $comment->comment_content );
classes/Column/Link/Actions.php CHANGED
@@ -37,7 +37,7 @@ class AC_Column_Link_Actions extends AC_Column {
37
$edit_link = get_edit_bookmark_link( $link );
38
39
$actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
40
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . "</a>";
41
42
return implode( ' | ', $actions );
43
}
37
$edit_link = get_edit_bookmark_link( $link );
38
39
$actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
40
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete.", 'codepress-admin-columns' ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . "</a>";
41
42
return implode( ' | ', $actions );
43
}
classes/Column/Media/Actions.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * @since 2.0
9
- */
10
- class AC_Column_Media_Actions extends AC_Column_Actions {
11
-
12
- protected function get_object_type() {
13
- return 'media';
14
- }
15
-
16
- }
classes/Column/Media/AlternateText.php CHANGED
@@ -11,7 +11,7 @@ class AC_Column_Media_AlternateText extends AC_Column_Meta {
11
12
public function __construct() {
13
$this->set_type( 'column-alternate_text' );
14
- $this->set_label( __( 'Alt', 'codepress-admin-columns' ) );
15
}
16
17
public function get_meta_key() {
11
12
public function __construct() {
13
$this->set_type( 'column-alternate_text' );
14
+ $this->set_label( __( 'Alternative Text', 'codepress-admin-columns' ) );
15
}
16
17
public function get_meta_key() {
classes/Column/Media/AttachedTo.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * @since 2.0
9
- */
10
- class AC_Column_Media_AttachedTo extends AC_Column {
11
-
12
- public function __construct() {
13
- $this->set_type( 'column-attached_to' );
14
- $this->set_label( __( 'Attached to Post', 'codepress-admin-columns' ) );
15
- }
16
-
17
- public function get_value( $id ) {
18
- $value = false;
19
-
20
- if ( $attached_to = $this->get_raw_value( $id ) ) {
21
- $value = ac_helper()->html->link( get_edit_post_link( $id ), get_the_title( $attached_to ) );
22
- }
23
-
24
- return $value;
25
- }
26
-
27
- public function get_raw_value( $id ) {
28
- return ac_helper()->post->get_raw_field( 'post_parent', $id );
29
- }
30
-
31
- }
classes/Column/Media/AvailableSizes.php CHANGED
@@ -7,9 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
/**
8
* @since 2.0
9
*/
10
- class AC_Column_Media_AvailableSizes extends AC_Column_Media_Meta {
11
-
12
- private $intermediate_image_sizes = null;
13
14
public function __construct() {
15
parent::__construct();
@@ -18,18 +16,8 @@ class AC_Column_Media_AvailableSizes extends AC_Column_Media_Meta {
18
$this->set_label( __( 'Available Sizes', 'codepress-admin-columns' ) );
19
}
20
21
- public function get_intermediate_image_sizes() {
22
- if ( null === $this->intermediate_image_sizes ) {
23
- $this->intermediate_image_sizes = get_intermediate_image_sizes();
24
- }
25
-
26
- return $this->intermediate_image_sizes;
27
- }
28
-
29
- public function get_available_sizes( $id ) {
30
- $sizes = $this->get_raw_value( $id );
31
-
32
- return $sizes ? array_intersect( array_keys( $sizes ), $this->get_intermediate_image_sizes() ) : false;
33
}
34
35
public function get_value( $id ) {
@@ -41,45 +29,66 @@ class AC_Column_Media_AvailableSizes extends AC_Column_Media_Meta {
41
42
$paths = array();
43
44
- // available sizes
45
- if ( $intersect = array_intersect( array_keys( $sizes ), get_intermediate_image_sizes() ) ) {
46
47
$url = wp_get_attachment_url( $id );
48
- $filename = basename( $url );
49
- $paths[] = "<a title='{$filename}' href='{$url}'>" . __( 'full size', 'codepress-admin-columns' ) . "</a>";
50
51
- foreach ( $intersect as $size ) {
52
$src = wp_get_attachment_image_src( $id, $size );
53
54
if ( ! empty( $src[0] ) ) {
55
- $filename = basename( $src[0] );
56
- $paths[] = "<a title='{$filename}' href='{$src[0]}' class='available'>{$size}</a>";
57
}
58
}
59
}
60
61
- global $_wp_additional_image_sizes;
62
-
63
- if ( ! empty( $_wp_additional_image_sizes ) ) {
64
- if ( isset( $_wp_additional_image_sizes['post-thumbnail'] ) ) {
65
- unset( $_wp_additional_image_sizes['post-thumbnail'] );
66
- }
67
68
- // image does not have these additional sizes rendered yet
69
- if ( $missing = array_diff( array_keys( $_wp_additional_image_sizes ), array_keys( $sizes ) ) ) {
70
foreach ( $missing as $size ) {
71
- $paths[] = "<span title='Missing size: Try regenerate thumbnails with the plugin: Force Regenerate Thumbnails' href='javascript:;' class='not-available'>{$size}</span>";
72
}
73
}
74
}
75
76
- return "<div class='sizes'>" . implode( ac_helper()->html->divider(), $paths ) . "</div>";
77
}
78
79
- public function get_raw_value( $id ) {
80
- $value = parent::get_raw_value( $id );
81
82
- return isset( $value['sizes'] ) ? $value['sizes'] : false;
83
}
84
85
}
7
/**
8
* @since 2.0
9
*/
10
+ class AC_Column_Media_AvailableSizes extends AC_Column_Media_MetaValue {
11
12
public function __construct() {
13
parent::__construct();
16
$this->set_label( __( 'Available Sizes', 'codepress-admin-columns' ) );
17
}
18
19
+ protected function get_option_name() {
20
+ return 'sizes';
21
}
22
23
public function get_value( $id ) {
29
30
$paths = array();
31
32
+ if ( $available_sizes = $this->get_available_sizes( $sizes ) ) {
33
34
$url = wp_get_attachment_url( $id );
35
+ $paths[] = ac_helper()->html->tooltip( ac_helper()->html->link( $url, __( 'original', 'codepress-admin-columns' ) ), basename( $url ) );
36
37
+ foreach ( $available_sizes as $size ) {
38
$src = wp_get_attachment_image_src( $id, $size );
39
40
if ( ! empty( $src[0] ) ) {
41
+ $paths[] = ac_helper()->html->tooltip( ac_helper()->html->link( $src[0], $size ), basename( $src[0] ) );
42
}
43
}
44
}
45
46
+ // include missing image sizes?
47
+ if ( '1' === $this->get_setting( 'include_missing_sizes' )->get_value() ) {
48
49
+ if ( $missing = $this->get_missing_sizes( $sizes ) ) {
50
foreach ( $missing as $size ) {
51
+ $paths[] = ac_helper()->html->tooltip( $size, sprintf( __( 'Missing image file for size %s.', 'codepress-admin-columns' ), '<em>"' . $size . '"</em>' ), array( 'class' => 'ac-missing-size' ) );
52
}
53
}
54
}
55
56
+ return "<div class='ac-image-sizes'>" . implode( ac_helper()->html->divider(), $paths ) . "</div>";
57
}
58
59
+ /**
60
+ * @param array $image_sizes
61
+ *
62
+ * @return array
63
+ */
64
+ public function get_available_sizes( $image_sizes ) {
65
+ return array_intersect( array_keys( (array) $image_sizes ), (array) get_intermediate_image_sizes() );
66
+ }
67
+
68
+ /**
69
+ * @param array $image_sizes
70
+ *
71
+ * @return array
72
+ */
73
+ public function get_missing_sizes( $image_sizes ) {
74
+ global $_wp_additional_image_sizes;
75
+
76
+ if ( empty( $_wp_additional_image_sizes ) ) {
77
+ return array();
78
+ }
79
+
80
+ $additional_size = $_wp_additional_image_sizes;
81
+
82
+ if ( isset( $additional_size['post-thumbnail'] ) ) {
83
+ unset( $additional_size['post-thumbnail'] );
84
+ }
85
+
86
+ // image does not have these additional sizes rendered yet
87
+ return array_diff( array_keys( (array) $additional_size ), array_keys( (array) $image_sizes ) );
88
+ }
89
90
+ public function register_settings() {
91
+ $this->add_setting( new AC_Settings_Column_MissingImageSize( $this ) );
92
}
93
94
}
classes/Column/Media/Dimensions.php CHANGED
@@ -16,25 +16,22 @@ class AC_Column_Media_Dimensions extends AC_Column_Media_Meta {
16
$this->set_label( __( 'Dimensions', 'codepress-admin-columns' ) );
17
}
18
19
- public function get_surface( $id ) {
20
$meta = $this->get_raw_value( $id );
21
22
- $height = ! empty( $meta['height'] ) ? $meta['height'] : 0;
23
- $width = ! empty( $meta['width'] ) ? $meta['width'] : 0;
24
-
25
- return $height * $width;
26
- }
27
28
- public function get_value( $id ) {
29
- $value = $this->get_empty_char();
30
31
- $meta = $this->get_raw_value( $id );
32
33
- if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) {
34
- $value = "{$meta['width']} x {$meta['height']}";
35
- }
36
37
- return $value;
38
}
39
40
}
16
$this->set_label( __( 'Dimensions', 'codepress-admin-columns' ) );
17
}
18
19
+ public function get_value( $id ) {
20
$meta = $this->get_raw_value( $id );
21
22
+ if ( empty( $meta['width'] ) || empty( $meta['height'] ) ) {
23
+ return $this->get_empty_char();
24
+ }
25
26
+ $value = $meta['width'] . '&nbsp;&times;&nbsp;' . $meta['height'];
27
28
+ $tooltip = sprintf( __( 'Width : %s px', 'codepress-admin-columns' ), $meta['width'] ) . "<br/>\n" . sprintf( __( 'Height : %s px', 'codepress-admin-columns' ), $meta['height'] );
29
30
+ return ac_helper()->html->tooltip( $this->get_formatted_value( $value ), $tooltip );
31
+ }
32
33
+ public function register_settings() {
34
+ $this->add_setting( new AC_Settings_Column_BeforeAfter( $this ) );
35
}
36
37
}
classes/Column/Media/ExifData.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
/**
8
* @since 2.0
9
*/
10
- class AC_Column_Media_ExifData extends AC_Column_Media_Meta {
11
12
public function __construct() {
13
parent::__construct();
@@ -16,10 +16,8 @@ class AC_Column_Media_ExifData extends AC_Column_Media_Meta {
16
$this->set_label( __( 'EXIF Data', 'codepress-admin-columns' ) );
17
}
18
19
- public function get_raw_value( $id ) {
20
- $value = parent::get_raw_value( $id );
21
-
22
- return ! empty( $value['image_meta'] ) ? $value['image_meta'] : false;
23
}
24
25
public function is_valid() {
7
/**
8
* @since 2.0
9
*/
10
+ class AC_Column_Media_ExifData extends AC_Column_Media_MetaValue {
11
12
public function __construct() {
13
parent::__construct();
16
$this->set_label( __( 'EXIF Data', 'codepress-admin-columns' ) );
17
}
18
19
+ protected function get_option_name() {
20
+ return 'image_meta';
21
}
22
23
public function is_valid() {
classes/Column/Media/Height.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
/**
8
* @since 2.0
9
*/
10
- class AC_Column_Media_Height extends AC_Column_Media_Meta {
11
12
public function __construct() {
13
parent::__construct();
@@ -16,16 +16,18 @@ class AC_Column_Media_Height extends AC_Column_Media_Meta {
16
$this->set_label( __( 'Height', 'codepress-admin-columns' ) );
17
}
18
19
public function get_value( $id ) {
20
$value = $this->get_raw_value( $id );
21
22
- return $value ? $value . 'px' : $this->get_empty_char();
23
- }
24
-
25
- public function get_raw_value( $id ) {
26
- $value = parent::get_raw_value( $id );
27
28
- return ! empty( $value['height'] ) ? $value['height'] : false;
29
}
30
31
}
7
/**
8
* @since 2.0
9
*/
10
+ class AC_Column_Media_Height extends AC_Column_Media_MetaValue {
11
12
public function __construct() {
13
parent::__construct();
16
$this->set_label( __( 'Height', 'codepress-admin-columns' ) );
17
}
18
19
+ protected function get_option_name() {
20
+ return 'height';
21
+ }
22
+
23
public function get_value( $id ) {
24
$value = $this->get_raw_value( $id );
25
26
+ if ( ! $value ) {
27
+ return $this->get_empty_char();
28
+ }
29
30
+ return $value . 'px';
31
}
32
33
}
classes/Column/Media/ID.php CHANGED
@@ -14,7 +14,7 @@ class AC_Column_Media_ID extends AC_Column {
14
$this->set_label( __( 'ID', 'codepress-admin-columns' ) );
15
}
16
17
- public function get_value( $id ) {
18
return $id;
19
}
20
14
$this->set_label( __( 'ID', 'codepress-admin-columns' ) );
15
}
16
17
+ public function get_raw_value( $id ) {
18
return $id;
19
}
20
classes/Column/Media/MetaValue.php ADDED
@@ -0,0 +1,26 @@
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * @since 4.0.8
9
+ */
10
+ abstract class AC_Column_Media_MetaValue extends AC_Column_Media_Meta {
11
+
12
+ abstract protected function get_option_name();
13
+
14
+ public function get_raw_value( $id ) {
15
+ $value = parent::get_raw_value( $id );
16
+
17
+ $option = $this->get_option_name();
18
+
19
+ if ( empty( $value[ $option ] ) ) {
20
+ return false;
21
+ }
22
+
23
+ return $value[ $option ];
24
+ }
25
+
26
+ }
classes/Column/Media/Width.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
/**
8
* @since 2.0
9
*/
10
- class AC_Column_Media_Width extends AC_Column_Media_Meta {
11
12
public function __construct() {
13
parent::__construct();
@@ -16,16 +16,8 @@ class AC_Column_Media_Width extends AC_Column_Media_Meta {
16
$this->set_label( __( 'Width', 'codepress-admin-columns' ) );
17
}
18
19
- public function get_value( $id ) {
20
- $value = $this->get_raw_value( $id );
21
-
22
- return $value ? $value . 'px' : $this->get_empty_char();
23
- }
24
-
25
- public function get_raw_value( $id ) {
26
- $value = parent::get_raw_value( $id );
27
-
28
- return ! empty( $value['width'] ) ? $value['width'] : false;
29
}
30
31
}
7
/**
8
* @since 2.0
9
*/
10
+ class AC_Column_Media_Width extends AC_Column_Media_Height {
11
12
public function __construct() {
13
parent::__construct();
16
$this->set_label( __( 'Width', 'codepress-admin-columns' ) );
17
}
18
19
+ protected function get_option_name() {
20
+ return 'width';
21
}
22
23
}
classes/Column/{UsedByMenu.php → Menu.php} RENAMED
@@ -10,18 +10,25 @@ if ( ! defined( 'ABSPATH' ) ) {
10
*
11
* @since 2.2.5
12
*/
13
- class AC_Column_UsedByMenu extends AC_Column {
14
15
public function __construct() {
16
$this->set_type( 'column-used_by_menu' );
17
- $this->set_label( __( 'Used by Menu', 'codepress-admin-columns' ) );
18
}
19
20
/**
21
* @see AC_Column::get_raw_value()
22
* @since 2.2.5
23
*/
24
- function get_raw_value( $object_id ) {
25
$object_type = $this->get_post_type();
26
27
if ( ! $object_type ) {
@@ -32,6 +39,30 @@ class AC_Column_UsedByMenu extends AC_Column {
32
$object_type = $this->get_list_screen()->get_meta_type();
33
}
34
35
$menu_item_ids = get_posts( array(
36
'post_type' => 'nav_menu_item',
37
'posts_per_page' => -1,
@@ -44,19 +75,32 @@ class AC_Column_UsedByMenu extends AC_Column {
44
),
45
array(
46
'key' => '_menu_item_object',
47
- 'value' => $object_type,
48
),
49
),
50
) );
51
52
if ( ! $menu_item_ids ) {
53
- return false;
54
}
55
56
- $menu_ids = wp_get_object_terms( $menu_item_ids, 'nav_menu', array( 'fields' => 'ids' ) );
57
58
if ( ! $menu_ids || is_wp_error( $menu_ids ) ) {
59
- return false;
60
}
61
62
return $menu_ids;
10
*
11
* @since 2.2.5
12
*/
13
+ class AC_Column_Menu extends AC_Column {
14
15
public function __construct() {
16
$this->set_type( 'column-used_by_menu' );
17
+ $this->set_label( __( 'Menu', 'codepress-admin-columns' ) );
18
}
19
20
/**
21
* @see AC_Column::get_raw_value()
22
* @since 2.2.5
23
*/
24
+ public function get_raw_value( $object_id ) {
25
+ return $this->get_menus( $object_id, array( 'fields' => 'ids' ) );
26
+ }
27
+
28
+ /**
29
+ * @return string Object type: 'post', 'page' or 'user'
30
+ */
31
+ public function get_object_type() {
32
$object_type = $this->get_post_type();
33
34
if ( ! $object_type ) {
39
$object_type = $this->get_list_screen()->get_meta_type();
40
}
41
42
+ return $object_type;
43
+ }
44
+
45
+ /**
46
+ * @return string
47
+ */
48
+ public function get_item_type() {
49
+ $item_type = $this->get_list_screen()->get_meta_type();
50
+
51
+ switch ( $item_type ) {
52
+ case 'post' :
53
+ $item_type = 'post_type';
54
+ break;
55
+ }
56
+
57
+ return $item_type;
58
+ }
59
+
60
+ /**
61
+ * @param int $object_id
62
+ *
63
+ * @return array
64
+ */
65
+ public function get_menu_item_ids( $object_id ) {
66
$menu_item_ids = get_posts( array(
67
'post_type' => 'nav_menu_item',
68
'posts_per_page' => -1,
75
),
76
array(
77
'key' => '_menu_item_object',
78
+ 'value' => $this->get_object_type(),
79
),
80
),
81
) );
82
83
+ return $menu_item_ids;
84
+ }
85
+
86
+ /**
87
+ * @param int $object_id
88
+ * @param array $args
89
+ *
90
+ * @return array
91
+ */
92
+ public function get_menus( $object_id, $args = array() ) {
93
+
94
+ $menu_item_ids = $this->get_menu_item_ids( $object_id );
95
+
96
if ( ! $menu_item_ids ) {
97
+ return array();
98
}
99
100
+ $menu_ids = wp_get_object_terms( $menu_item_ids, 'nav_menu', $args );
101
102
if ( ! $menu_ids || is_wp_error( $menu_ids ) ) {
103
+ return array();
104
}
105
106
return $menu_ids;
classes/Column/Meta.php CHANGED
@@ -41,7 +41,7 @@ abstract class AC_Column_Meta extends AC_Column {
41
public function get_raw_value( $id ) {
42
$value = $this->get_meta_value( $id, $this->get_meta_key(), true );
43
44
- if( ! $value ){
45
return false;
46
}
47
@@ -61,9 +61,9 @@ abstract class AC_Column_Meta extends AC_Column {
61
/**
62
* Get meta value
63
*
64
- * @param int $id
65
* @param string $meta_key
66
- * @param bool $single
67
*
68
* @return mixed
69
*/
41
public function get_raw_value( $id ) {
42
$value = $this->get_meta_value( $id, $this->get_meta_key(), true );
43
44
+ if ( ! $value ) {
45
return false;
46
}
47
61
/**
62
* Get meta value
63
*
64
+ * @param int $id
65
* @param string $meta_key
66
+ * @param bool $single
67
*
68
* @return mixed
69
*/
classes/Column/Post/Actions.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * @since 2.0
9
- */
10
- class AC_Column_Post_Actions extends AC_Column_Actions {
11
-
12
- protected function get_object_type() {
13
- return 'post';
14
- }
15
-
16
- }
classes/Column/Post/Attachment.php CHANGED
@@ -40,7 +40,7 @@ class AC_Column_Post_Attachment extends AC_Column {
40
}
41
42
public function register_settings() {
43
- $this->add_setting( new AC_Settings_Column_Image( $this ) );
44
}
45
46
}
40
}
41
42
public function register_settings() {
43
+ $this->add_setting( new AC_Settings_Column_AttachmentDisplay( $this ) );
44
}
45
46
}
classes/Column/Post/AttachmentCount.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * Column displaying number of attachment for an item.
9
- *
10
- * @since 2.0
11
- */
12
- class AC_Column_Post_AttachmentCount extends AC_Column {
13
-
14
- public function __construct() {
15
- $this->set_type( 'column-attachment_count' );
16
- $this->set_label( __( 'Attachment Count', 'codepress-admin-columns' ) );
17
- }
18
-
19
- public function get_raw_value( $post_id ) {
20
- $attachment_ids = get_posts( array(
21
- 'post_type' => 'attachment',
22
- 'posts_per_page' => -1,
23
- 'post_status' => null,
24
- 'post_parent' => $post_id,
25
- 'fields' => 'ids',
26
- ) );
27
-
28
- return count( $attachment_ids );
29
- }
30
-
31
- }