Admin Columns - Version 3.1

Version Description

Release Date: January 29th, 2018

  • [Improved] Admin Columns Capability is now always set
  • [Improved] Database update message is only visible for administartors
  • [Improved] Links starting with # are now marked as internal
  • [Removed] Removed support for the Link/Bookmark list table
  • [Added] Added date time settings for columns that use dates
Download this release

Release Info

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

Code changes from version 3.0.7 to 3.1

Files changed (87) hide show
  1. assets/css/admin-page-addons.min.css +1 -1
  2. assets/css/admin-page-columns.css +2 -1
  3. assets/css/admin-page-columns.min.css +1 -1
  4. classes/API.php +0 -1
  5. classes/Admin/Addons.php +1 -1
  6. classes/Admin/Page/Columns.php +32 -22
  7. classes/Column.php +1 -23
  8. classes/Column/Comment/AuthorAvatar.php +1 -1
  9. classes/Column/Comment/User.php +6 -0
  10. classes/Column/Post/AuthorName.php +6 -0
  11. classes/Column/Post/FeaturedImage.php +3 -11
  12. classes/Column/Post/LastModifiedAuthor.php +10 -0
  13. classes/Column/User/CommentCount.php +0 -4
  14. classes/Column/User/FirstName.php +7 -1
  15. classes/Column/User/LastName.php +7 -1
  16. classes/{Settings/Form → Form}/Element.php +1 -1
  17. classes/{Settings/Form → Form}/Element/Checkbox.php +2 -2
  18. classes/{Settings/Form → Form}/Element/Input.php +1 -1
  19. classes/{Settings/Form → Form}/Element/Radio.php +1 -1
  20. classes/Form/Element/Select.php +100 -0
  21. classes/Helper/Html.php +8 -0
  22. classes/Helper/Icon.php +5 -0
  23. classes/Helper/Image.php +1 -1
  24. classes/ListScreen.php +23 -57
  25. classes/ListScreen/Comment.php +26 -13
  26. classes/ListScreen/Link.php +0 -42
  27. classes/ListScreen/Media.php +19 -10
  28. classes/ListScreen/Post.php +14 -8
  29. classes/ListScreen/User.php +33 -12
  30. classes/ListScreenPost.php +50 -5
  31. classes/ListScreenWP.php +99 -0
  32. classes/Meta/Query.php +20 -5
  33. classes/Plugin.php +39 -3
  34. classes/Plugin/Updater.php +27 -11
  35. classes/Settings/Column.php +5 -4
  36. classes/Settings/Column/AttachmentDisplay.php +3 -1
  37. classes/Settings/Column/Comment.php +140 -0
  38. classes/Settings/Column/Date.php +20 -125
  39. classes/Settings/Column/DateTimeFormat.php +192 -0
  40. classes/Settings/Column/Image.php +4 -4
  41. classes/Settings/Column/Images.php +1 -1
  42. classes/Settings/Column/Meta.php +1 -1
  43. classes/Settings/Column/StringLimit.php +1 -1
  44. classes/Settings/Column/Time.php +38 -0
  45. classes/Settings/Column/User.php +13 -97
  46. classes/Settings/Column/UserLink.php +100 -0
  47. classes/Settings/Form/Element/Select.php +4 -78
  48. classes/TableScreen.php +19 -3
  49. codepress-admin-columns.php +36 -57
  50. languages/codepress-admin-columns-ar_AR.mo +0 -0
  51. languages/codepress-admin-columns-ar_AR.po +304 -235
  52. languages/codepress-admin-columns-bt_BR.mo +0 -0
  53. languages/codepress-admin-columns-bt_BR.po +464 -395
  54. languages/codepress-admin-columns-da_DK.mo +0 -0
  55. languages/codepress-admin-columns-da_DK.po +304 -235
  56. languages/codepress-admin-columns-de_DE.mo +0 -0
  57. languages/codepress-admin-columns-de_DE.po +307 -238
  58. languages/codepress-admin-columns-en_NZ.mo +0 -0
  59. languages/codepress-admin-columns-en_NZ.po +304 -235
  60. languages/codepress-admin-columns-es_ES.mo +0 -0
  61. languages/codepress-admin-columns-es_ES.po +304 -235
  62. languages/codepress-admin-columns-fa_IR.mo +0 -0
  63. languages/codepress-admin-columns-fa_IR.po +304 -235
  64. languages/codepress-admin-columns-fr_FR.mo +0 -0
  65. languages/codepress-admin-columns-fr_FR.po +433 -362
  66. languages/codepress-admin-columns-he_IL.mo +0 -0
  67. languages/codepress-admin-columns-he_IL.po +304 -235
  68. languages/codepress-admin-columns-hu_HU.mo +0 -0
  69. languages/codepress-admin-columns-hu_HU.po +304 -235
  70. languages/codepress-admin-columns-it_IT.mo +0 -0
  71. languages/codepress-admin-columns-it_IT.po +305 -236
  72. languages/codepress-admin-columns-ja_JA.mo +0 -0
  73. languages/codepress-admin-columns-ja_JA.po +304 -237
  74. languages/codepress-admin-columns-nl_NL.mo +0 -0
  75. languages/codepress-admin-columns-nl_NL.po +304 -235
  76. languages/codepress-admin-columns-pl_PL.mo +0 -0
  77. languages/codepress-admin-columns-pl_PL.po +304 -235
  78. languages/codepress-admin-columns-ro_RO.mo +0 -0
  79. languages/codepress-admin-columns-ro_RO.po +306 -237
  80. languages/codepress-admin-columns-ru_RU.mo +0 -0
  81. languages/codepress-admin-columns-ru_RU.po +305 -236
  82. languages/codepress-admin-columns-sv_SE.mo +0 -0
  83. languages/codepress-admin-columns-sv_SE.po +304 -235
  84. languages/codepress-admin-columns-zh_CN.mo +0 -0
  85. languages/codepress-admin-columns-zh_CN.po +304 -235
  86. readme.txt +13 -3
  87. templates/settings/setting-date.php +22 -16
assets/css/admin-page-addons.min.css CHANGED
@@ -1 +1 @@
1
- .ac-addon{display:inline-block;margin-right:16px;float:left}.ac-addon.group-default{float:none;clear:both;display:table}.ac-addon h2{border-bottom:1px solid #ccc;padding-bottom:10px}.ac-addon ul{overflow:hidden}.ac-addon ul li{width:200px;background:#fff;float:left;margin-right:16px;margin-bottom:16px;border:1px solid #ddd;box-shadow:0 3px 10px 0 rgba(0,0,0,.15)}.ac-addon ul li:last-child{margin-right:0}.ac-addon ul li:hover{box-shadow:0 3px 10px 0 rgba(0,0,0,.25)}.ac-addon ul li a{color:#444}.ac-addon ul li .addon-header{display:table;width:100%;height:125px;text-align:center;vertical-align:middle;border-top:1px solid #ddd;background:#0069a4;background:-webkit-gradient(radial,center center,0,center center,100%,color-stop(0,#0069a4),color-stop(100%,#085079));background:-webkit-radial-gradient(center,ellipse cover,#0069a4 0,#085079 100%);background:radial-gradient(ellipse at center,#0069a4 0,#085079 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="$addon-color-lightblue",endColorstr="$addon-color-blue",GradientType=1)}.ac-addon ul li .addon-header .inner{display:table-cell;vertical-align:middle;padding:15px 20px}.ac-addon ul li .addon-header .inner h3{padding:0 16px;color:#fff;line-height:150%}.ac-addon ul li .addon-header .inner img{display:inline-block;max-height:52px;max-width:100%}.ac-addon ul li .addon-notice{background-color:#fff8e5;margin:0;padding:15px}.ac-addon ul li .addon-notice a{font-weight:700;text-decoration:none;color:#0073aa}.ac-addon ul li .addon-content{width:100%;padding:25px 15px;box-sizing:border-box;min-height:162px}.ac-addon ul li .addon-content>:first-child{margin-top:0}.ac-addon ul li .addon-content>:last-child{margin-bottom:0}.ac-addon ul li .addon-actions{background:#eee;border-top:1px solid #ddd;padding:8px;overflow:hidden}.ac-addon ul li .addon-actions span.active,.ac-addon ul li .addon-actions span.active:hover{display:inline-block;height:28px;line-height:28px;cursor:default;border-color:#69c471;color:#388f40;margin-left:8px}.ac-addon ul li .addon-actions span.active:before,.ac-addon ul li .addon-actions span.active:hover:before{content:"\f147";font-family:dashicons,sans-serif;vertical-align:middle;font-size:17px;margin:-2px 3px 0 -5px}.ac-addon ul li.ac-addon-buddypress .addon-header .inner img,.ac-addon ul li.ac-addon-types .addon-header .inner img{max-height:68px}
1
+ .ac-addon{display:inline-block;margin-right:16px;float:left}.ac-addon.group-default{float:none;clear:both;display:table}.ac-addon h2{border-bottom:1px solid #ccc;padding-bottom:10px}.ac-addon ul{overflow:hidden}.ac-addon ul li{width:200px;background:#fff;float:left;margin-right:16px;margin-bottom:16px;border:1px solid #ddd;box-shadow:0 3px 10px 0 rgba(0,0,0,.15)}.ac-addon ul li:last-child{margin-right:0}.ac-addon ul li:hover{box-shadow:0 3px 10px 0 rgba(0,0,0,.25)}.ac-addon ul li a{color:#444}.ac-addon ul li .addon-header{display:table;width:100%;height:125px;text-align:center;vertical-align:middle;border-top:1px solid #ddd;background:#0069a4;background:radial-gradient(ellipse at center,#0069a4 0,#085079 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="$addon-color-lightblue",endColorstr="$addon-color-blue",GradientType=1)}.ac-addon ul li .addon-header .inner{display:table-cell;vertical-align:middle;padding:15px 20px}.ac-addon ul li .addon-header .inner h3{padding:0 16px;color:#fff;line-height:150%}.ac-addon ul li .addon-header .inner img{display:inline-block;max-height:52px;max-width:100%}.ac-addon ul li .addon-notice{background-color:#fff8e5;margin:0;padding:15px}.ac-addon ul li .addon-notice a{font-weight:700;text-decoration:none;color:#0073aa}.ac-addon ul li .addon-content{width:100%;padding:25px 15px;box-sizing:border-box;min-height:162px}.ac-addon ul li .addon-content>:first-child{margin-top:0}.ac-addon ul li .addon-content>:last-child{margin-bottom:0}.ac-addon ul li .addon-actions{background:#eee;border-top:1px solid #ddd;padding:8px;overflow:hidden}.ac-addon ul li .addon-actions span.active,.ac-addon ul li .addon-actions span.active:hover{display:inline-block;height:28px;line-height:28px;cursor:default;border-color:#69c471;color:#388f40;margin-left:8px}.ac-addon ul li .addon-actions span.active:before,.ac-addon ul li .addon-actions span.active:hover:before{content:"\f147";font-family:dashicons,sans-serif;vertical-align:middle;font-size:17px;margin:-2px 3px 0 -5px}.ac-addon ul li.ac-addon-buddypress .addon-header .inner img,.ac-addon ul li.ac-addon-types .addon-header .inner img{max-height:68px}
assets/css/admin-page-columns.css CHANGED
@@ -624,7 +624,8 @@
624
position: relative;
625
background: #fff;
626
z-index: 2;
627
- padding-right: 8px; }
628
.ac-right .sidebox h3 span.contenttype {
629
display: block;
630
line-height: 20px;
624
position: relative;
625
background: #fff;
626
z-index: 2;
627
+ padding-right: 8px;
628
+ float: none; }
629
.ac-right .sidebox h3 span.contenttype {
630
display: block;
631
line-height: 20px;
assets/css/admin-page-columns.min.css CHANGED
@@ -1 +1 @@
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:""}.ui-sortable-helper{box-shadow:1px 3px 6px 0 rgba(1,1,1,.4)}.ui-sortable-helper .column-meta{border-width:1px}.ac-column .comment-grey-bubble{height:16px;width:16px}.ac-column .comment-grey-bubble:before{content:"\f101";font:normal 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:5px;left:0;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.rtl .ac-column .comment-grey-bubble:before{right:0;left:auto}.ac-admin{margin-right:300px;max-width:740px}.ac-admin #add-new-column-template{display:none}.ac-admin .ac-left{float:left;width:100%}.ac-admin .ac-left .column-footer a.add_column{padding-left:16px;padding-right:16px;text-align:center}.ac-admin .ac-left .column-footer a.submit.save,.ac-admin .ac-left .column-footer a.submit.update{padding-left:20px;padding-right:20px;text-align:center}.ac-admin .ac-left .column-footer .submit.save{display:inline-block}.ac-admin .ac-left .column-footer .submit.update{display:none}.ac-admin .ac-right{float:right;margin-right:-300px;width:280px}.ac-admin .ac-right .ac-right-inside.fixed{width:280px}.ac-admin .column-footer .spinner{display:none}.ac-admin.saving .ac-right-inside .spinner{visibility:visible}.ac-admin.saving .column-footer .spinner{margin:4px 0 0;background-position:50%;float:none;display:inline-block;visibility:visible}.ac-admin.stored .ac-right .sidebox.form-actions .submit.save{display:none}.ac-admin.stored .ac-right .sidebox.form-actions .form-reset,.ac-admin.stored .ac-right .sidebox.form-actions .submit.update{display:block}.ac-admin.stored .column-footer .submit.save{display:none}.ac-admin.stored .column-footer .submit.update{display:inline-block}.ac-left .ac-notice{background:#fff;border-left:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin-bottom:15px;padding:1px 12px}.ac-left .ajax-message{display:none}.ac-left .ac-message{margin-top:0!important}.ac-left .ac-boxes .ac-columns form{box-shadow:0 1px 3px rgba(0,0,0,.1);margin:0}.ac-left .ac-boxes.disabled{opacity:.7}.ac-left .ac-boxes.disabled .column_action,.ac-left .ac-boxes.disabled a.clone-button,.ac-left .ac-boxes.disabled a.remove-button{display:none!important}.ac-left .ac-boxes.disabled .column-meta td.column_sort{display:none}.ac-left .ac-boxes.disabled .column-meta td.column_label{padding-left:10px}.ac-left .ac-boxes.disabled .meta span{cursor:default!important;opacity:.45}.ac-left .ac-boxes.disabled .meta span:before{color:gray!important}.ac-left .ac-boxes.disabled .meta span.on{opacity:1}.ac-left .ac-boxes.disabled .column-footer{display:none}.ac-column a{cursor:pointer}.ac-column a:active,.ac-column a:focus{box-shadow:none}.ac-column.loading .ac-column-body>.spinner{position:absolute;left:50%;top:50%;z-index:5;margin-left:-10px;margin-top:-10px;display:block}.ac-column.loading .ac-column-body:before{content:"";position:absolute;width:100%;height:100%;background:#fff;z-index:4;opacity:.5}.ac-column.opened{margin-bottom:-1px}.ac-column.opened .ac-column-header{background-color:#eaeaea;border-color:#ccc}.ac-column.opened .ac-column-header:hover .column_label .inner>a.close-button{display:inline-block}.ac-column.opened .ac-column-header .column_edit:after{content:"\f142"}.ac-column.opened .ac-column-header table td{border-color:#f8f8f8;color:#333;text-shadow:0 1px 0 #fff}.ac-column.opened .ac-column-header table td a{color:#333;text-shadow:0 1px 0 #fff}.ac-column.opened .ac-column-header table td.column_sort span{color:#9b9b9b}.ac-column.opened .ac-column-header table td.column_label .meta span{color:#8d8d8d;text-shadow:none}.ac-column.opened .ac-column-header table td.column_label a.edit-button{display:none}.ac-column.opened .ac-column-header table td.column_type{color:#5c5c5c}.ac-column.opened .ac-column-header table td.column_edit:after{color:#9b9b9b}.ac-column.opened .ac-column-body{border:1px solid #ccc;border-top:1px solid #d4d4d4}.ac-column-setting{width:100%;clear:both;border-spacing:0;margin:0;border-top:1px solid #e8e8e8}.ac-column-setting:first-child{border-top:0}.ac-column-setting tr.hide{display:none}.ac-column-setting tr td{vertical-align:top;border:none;padding:0;background:#fff}.ac-column-setting td.col-label{position:relative;line-height:24px;overflow:visible;background:#f5f5f5;border-right:1px solid #dedede;width:34%;padding:10px;padding-left:12px}.ac-column-setting td.col-label span.label{font-weight:700;display:block;color:#333;font-style:normal}.ac-column-setting td.col-label div.tooltip{font-size:12px;font-style:normal;line-height:16px;margin:0!important;display:none;position:absolute;max-width:200px;z-index:3;top:40px;left:0;font-weight:400;color:#fff;background-color:#333;box-shadow:0 1px 3px rgba(0,0,0,.2);padding:.618em 1em;border-radius:3px}.ac-column-setting td.col-label div.tooltip em{margin-top:3px;display:block;color:#999}.ac-column-setting td.col-input div.msg{margin-top:5px;display:none;color:#333;padding:6px 10px;background-color:#ffebe8;border:1px solid #fff;border-radius:3px}.ac-column-setting td.col-input div.msg p{margin:.5em 0 1em}.ac-column-setting td.col-input div.msg a.button{margin-bottom:1em}.ac-column-setting td.col-input .help-msg{margin:10px 0 0;color:#666;font-size:13px}.ac-column-setting .ac-column-setting td.col_label{background-color:#fcfcfc}.ac-column-setting .ac-column-setting td.col_label .label{font-size:12px;color:#595959}.ac-column-setting span.ac-setting-error{display:block;margin:0;background-color:#ffebe8;padding:7px 10px}.ac-column-setting-actions .col-settings p{padding-left:10px}.ac-column-setting-actions .col-settings a{text-decoration:none}.ac-column-setting-actions .col-settings a.clone-button,.ac-column-setting-actions .col-settings a.close-button{margin-right:10px}.ac-column-setting-actions .col-settings a.remove-button{color:#a00;text-decoration:none;text-shadow:none;margin-right:5px}.ac-column-setting-actions .col-settings a.remove-button:hover{color:red}.ac-setting-input{padding:10px;line-height:24px}.ac-setting-input input,.ac-setting-input select{width:99.95%}.ac-setting-input input[type=checkbox],.ac-setting-input input[type=radio]{width:auto;margin-right:4px}.ac-setting-input .checkbox-labels>label,.ac-setting-input .radio-labels>label{padding-right:10px;vertical-align:top}.ac-setting-input .checkbox-labels.vertical input[type=radio],.ac-setting-input .radio-labels.vertical input[type=radio]{margin-right:6px}.ac-setting-input .checkbox-labels.vertical>label,.ac-setting-input .radio-labels.vertical>label{display:block;margin-bottom:5px}.ac-setting-input-date .ac-setting-input-date__custom{display:inline-block;width:71px;margin-right:5px}.ac-setting-input-date .ac-setting-input-date__value{display:inline-block;width:165px}.ac-setting-input-date .ac-setting-input-date__example{margin-left:8px}.ac-setting-input-date .ac-setting-input-date__example .spinner{float:none;vertical-align:top}.ac-setting-input-date code{display:inline-block;min-width:60px;padding-top:0;padding-bottom:0;text-align:center}.ac-setting-input-width{position:relative}.ac-setting-input-width div.description{font-size:12px;width:68px;position:absolute;display:table}.ac-setting-input-width div.description input{margin:0;text-align:right;vertical-align:middle;display:table-cell}.ac-setting-input-width div.description input::-webkit-input-placeholder{font-size:13px}.ac-setting-input-width div.description input:-moz-placeholder,.ac-setting-input-width div.description input::-moz-placeholder{font-size:13px}.ac-setting-input-width div.description input:-ms-input-placeholder{font-size:13px}.ac-setting-input-width div.description span{background:#efefef;display:table-cell;width:26px;line-height:23px;text-align:center;vertical-align:middle;border:1px solid #dedede;border-left:none;color:#505050}.ac-setting-input-width div.width-slider{margin-left:82px;margin-right:88px;position:relative;top:8px}.ac-setting-input-width div.width-slider .ui-slider-handle{cursor:ew-resize}.ac-setting-input-width div.unit-select{position:absolute;top:11px;right:6px;width:82px;text-align:right}.ac-setting-input-width div.unit-select .radio-labels{padding:0}.ac-setting-input-width div.unit-select .radio-labels label{padding:0;margin-right:6px}.ac-setting-input-width div.unit-select .radio-labels label input{margin-right:2px}.ac-column-header{border-style:solid;border-color:#dfdfdf;border-width:1px 1px 0;background:#fcfcfc}.ac-column-header:nth-child(2n) .column-meta{background:#f9f9f9}.ac-column-header img{margin-right:3px}.ac-column-header table{border:none;background:transparent;border-radius:0}.ac-column-header table tr td{vertical-align:top;height:18px;padding:12px 8px;border-width:1px 0 0;border-style:solid;border-color:transparent}.ac-column-header table tr td.column_sort{position:relative;cursor:move;padding:9px 16px}.ac-column-header table tr td.column_sort span.cpacicon-move{position:absolute;top:12px;left:12px;font-size:22px;display:inline-block;color:#bdbdbd}.ac-column-header table tr td.column_label{width:70%;font-weight:700;vertical-align:middle;position:relative;padding:15px 0}.ac-column-header table tr td.column_label .inner{position:relative;overflow:hidden;height:18px}.ac-column-header table tr td.column_label .inner .toggle img{max-height:20px}.ac-column-header table tr td.column_label .inner>a{color:#5a5a5a;padding:0 4px}.ac-column-header table tr td.column_label .inner>a:hover{color:#333}.ac-column-header table tr td.column_label .inner>a.clone-button,.ac-column-header table tr td.column_label .inner>a.close-button,.ac-column-header table tr td.column_label .inner>a.edit-button,.ac-column-header table tr td.column_label .inner>a.remove-button{display:none;color:#0074a2;text-decoration:none;text-shadow:none;font-weight:400;margin-left:5px;font-size:12px}.ac-column-header table tr td.column_label .inner>a.clone-button:hover,.ac-column-header table tr td.column_label .inner>a.close-button:hover,.ac-column-header table tr td.column_label .inner>a.edit-button:hover,.ac-column-header table tr td.column_label .inner>a.remove-button:hover{color:#2ea2cc}.ac-column-header table tr td.column_label .inner>a.remove-button{color:#a00}.ac-column-header table tr td.column_label .inner>a.remove-button:hover{color:red}.ac-column-header table tr td.column_label .inner .meta{display:inline-block;float:right;font-weight:400;color:#b2b2b2;font-size:12px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting{cursor:pointer;margin-left:4px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-heading-setting--width{margin-right:3px;cursor:auto;color:#737373}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator{margin-left:3px;font-size:24px;line-height:17px;width:22px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator.ac-column-indicator--filter{font-size:20px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator.on,.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator.on span{color:#21759b}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.disabled{cursor:default}.ac-column-header table tr td.column_type{width:auto;min-width:120px;text-align:right;color:#999;padding-right:0}.ac-column-header table tr td.column_type .inner{display:inline-block;height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:120px;vertical-align:middle}.ac-column-header table tr td.column_type .inner a{margin-top:2px;color:#999}.ac-column-header table tr td.column_edit{width:38px;min-width:38px;text-align:center;cursor:pointer}.ac-column-header table tr td.column_edit:after{right:0;content:"\f140";font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0 5px 0 0;bottom:0;position:relative;vertical-align:bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#b4b9be}.ac-column-header table tr:hover td.column_sort span{color:#9b9b9b}.ac-column-header:hover .column_label .inner>a.clone-button,.ac-column-header:hover .column_label .inner>a.edit-button,.ac-column-header:hover .column_label .inner>a.remove-button{display:inline-block}.ac-column-header span.vers{padding-top:2px}.ac-column-body{display:none;border-width:1px 1px 0;border-style:solid;border-color:#dfdfdf;position:relative}.column-footer{background:#eaf2fa;border:1px solid #c7d7e2;min-height:26px;padding:8px;overflow:hidden}.column-footer .order-message{background:transparent url(../images/order_arrow.png) no-repeat 0 0;color:#7a9bbe;float:left;font-family:Comic Sans MS,sans-serif;font-size:11px;height:13px;line-height:1em;margin-left:4px;padding:7px 0 0 22px;text-shadow:0 1px 0 #fff;display:inline-block}.column-footer .button-container{float:right;display:inline-block;min-height:29px}.column-footer .button-container a{display:inline-block;margin-left:5px;vertical-align:top}.column-footer .button-container a.clear-columns{color:#bc0b0b;text-decoration:none;margin-right:8px;margin-top:5px}.column-footer .button-container a.clear-columns:hover{color:red}.ac-right .sidebox{background:none repeat scroll 0 0 #fff;border:1px solid #dedede;border-radius:0 0 0 0;box-shadow:0 1px 3px rgba(0,0,0,.1);position:relative;margin-bottom:14px}.ac-right .sidebox h3{padding:10px;margin:0;position:relative}.ac-right .sidebox h3.title{font-family:Georgia,Times New Roman,Bitstream Charter,Times,serif;font-size:15px;font-weight:400;line-height:1;margin:0;padding:7px 10px;background:#f1f1f1;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(0deg,#ececec,#f9f9f9);border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;box-shadow:0 1px 0 #fff;border-bottom-style:solid;border-bottom-width:1px}.ac-right .sidebox h3 span.left{position:relative;background:#fff;z-index:2;padding-right:8px}.ac-right .sidebox h3 span.contenttype{display:block;line-height:20px;font-size:12px;text-transform:uppercase;color:gray;margin-top:4px}.ac-right .sidebox h3 span.contenttype.right{position:absolute;display:inline-block;z-index:1;right:10px;text-align:right;margin-top:0}.ac-right .sidebox .inside{padding:10px}.ac-right .sidebox .inside p{margin-top:0}.ac-right .sidebox.form-actions .form-reset{display:none;border-bottom:1px solid #f5f5f5;padding:8px}.ac-right .sidebox.form-actions .reset-column-type{text-decoration:none;color:#bc0b0b;line-height:25px;display:inline-block;background:none;border:none;padding:0;font-size:13px;cursor:pointer;margin:0}.ac-right .sidebox.form-actions .reset-column-type:hover{color:red}.ac-right .sidebox.form-actions .form-update{padding:8px;overflow:hidden}.ac-right .sidebox.form-actions .submit{display:none;width:100%;height:28px;line-height:28px;text-align:center}.ac-right .sidebox.form-actions .submit.save{display:block}.ac-right .sidebox#direct-feedback #feedback-rate,.ac-right .sidebox#direct-feedback #feedback-support{display:none}.ac-right .sidebox#direct-feedback .inside>a{border-radius:4px;border:1px solid #ccc;width:48%;height:64px;text-align:center;line-height:64px;font-weight:700;color:#222;display:inline-block;text-decoration:none}.ac-right .sidebox#direct-feedback .inside>a:hover{background:#fafafa}.ac-right .sidebox#direct-feedback .inside form textarea{width:100%;height:120px}.ac-right .sidebox#direct-feedback .inside form input[type=submit]{display:inline-block;float:right;border-radius:4px;border:1px solid #ccc;height:32px;text-align:center;line-height:32px;font-weight:700;font-size:12px;padding:0 32px;color:#ccc;background:none;text-decoration:none;cursor:pointer}.ac-right .sidebox#direct-feedback .inside form input[type=submit]:hover{background:#fafafa}.ac-right .sidebox#direct-feedback .inside form p.description{float:left;font-size:10px}.ac-right .sidebox#direct-feedback .inside ul{margin:0}.ac-right .sidebox#direct-feedback .inside ul.share li{margin:0;display:block;float:left;margin-left:9px;width:30%}.ac-right .sidebox#direct-feedback .inside ul.share li a{text-decoration:none;vertical-align:middle;line-height:20px;padding:16px 0;width:100%;text-align:center;border:1px solid #ccc;border-radius:4px;display:block}.ac-right .sidebox#direct-feedback .inside ul.share li a:hover{background:#fafafa}.ac-right .sidebox#direct-feedback .inside ul.share li:first-child{margin-left:0}.ac-right .sidebox#direct-feedback #feedback-support .inside ul.share li{width:48%}#ac-pro-version{background:none}#ac-pro-version .padding-box{padding:20px 10px 10px;background:#3d4350;color:#fff}#ac-pro-version .nopadding{margin:0;padding:0}#ac-pro-version h2{color:#fff}#ac-pro-version h3{font-size:34px;line-height:40px}#ac-pro-version h3 a{text-decoration:none;color:#fff}#ac-pro-version h3 a span{color:#e9426e}#ac-pro-version sup{text-decoration:line-through;font-size:13px;color:#ccc}#ac-pro-version .ac-pro-prices{color:#ffcac0;text-decoration:none}#ac-pro-version .ac-pro-prices:hover{text-decoration:underline}#ac-pro-version .ac-pro-prices:hover sup{text-decoration:none}#ac-pro-version .acp-button{cursor:pointer}#ac-pro-version .more{color:#ffee85;text-decoration:none}#ac-pro-version .more:hover{text-decoration:underline}#ac-pro-version p.center{text-align:center}#ac-pro-version p.nomargin{margin-bottom:0}#ac-pro-version ul.features a:hover{text-decoration:underline}#ac-pro-version ul li{padding-bottom:3px}#ac-pro-version ul li a{color:#fff;text-decoration:none;padding-left:25px;position:relative;display:block}#ac-pro-version ul li a:before{content:"\2713";font-weight:700;font-size:16px;position:absolute;left:0;top:0}#ac-pro-version ul li.acp-integration{padding:0;min-height:23px;line-height:23px}#ac-pro-version ul li.acp-integration img{height:23px;display:inline-block;vertical-align:middle;margin-right:3px}#ac-pro-version ul li.acp-integration img.ac-addon-pods{margin-top:-4px}#ac-pro-version ul li.acp-integration img.ac-addon-types{height:18px}#ac-pro-version ul li.acp-integration img.cac-addon-acf{margin-top:-4px;height:15px}#ac-pro-version ul li.acp-integration a:before{content:"+"}#ac-pro-version .padding-box.ac-pro-deal{color:#3d4350;padding-bottom:20px;text-align:center;background:#ffef8f}#ac-pro-version .padding-box.ac-pro-deal h3{font-size:20px;line-height:26px;padding-top:0;padding-bottom:0;margin-bottom:18px}#ac-pro-version .padding-box.ac-pro-deal a.acp-button{font-size:16px}#ac-pro-version .padding-box.ac-pro-newsletter{background:#fff;color:#3d4350}#ac-pro-version .padding-box.ac-pro-newsletter h3{font-size:20px;padding-bottom:0}#ac-pro-version .padding-box.ac-pro-newsletter input{width:100%;margin-bottom:8px}#ac-pro-version .padding-box.ac-pro-newsletter .acp-button{margin-top:12px;margin-bottom:0;padding:7px 20px}#ac-pro-version .acp-button{background:#e9426e;border:none;color:#fff;text-decoration:none;text-align:center;display:block;padding:6px 20px;border-radius:3px}@media only screen and (max-width:900px){.ac-admin{margin-right:0}.ac-admin .ac-left,.ac-admin .menu{float:none}.ac-admin .ac-right{float:none;margin-top:0;margin-right:0;width:100%}}
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:""}.ui-sortable-helper{box-shadow:1px 3px 6px 0 rgba(1,1,1,.4)}.ui-sortable-helper .column-meta{border-width:1px}.ac-column .comment-grey-bubble{height:16px;width:16px}.ac-column .comment-grey-bubble:before{content:"\f101";font:normal 20px/.5 dashicons;speak:none;display:inline-block;padding:0;top:5px;left:0;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.rtl .ac-column .comment-grey-bubble:before{right:0;left:auto}.ac-admin{margin-right:300px;max-width:740px}.ac-admin #add-new-column-template{display:none}.ac-admin .ac-left{float:left;width:100%}.ac-admin .ac-left .column-footer a.add_column{padding-left:16px;padding-right:16px;text-align:center}.ac-admin .ac-left .column-footer a.submit.save,.ac-admin .ac-left .column-footer a.submit.update{padding-left:20px;padding-right:20px;text-align:center}.ac-admin .ac-left .column-footer .submit.save{display:inline-block}.ac-admin .ac-left .column-footer .submit.update{display:none}.ac-admin .ac-right{float:right;margin-right:-300px;width:280px}.ac-admin .ac-right .ac-right-inside.fixed{width:280px}.ac-admin .column-footer .spinner{display:none}.ac-admin.saving .ac-right-inside .spinner{visibility:visible}.ac-admin.saving .column-footer .spinner{margin:4px 0 0;background-position:50%;float:none;display:inline-block;visibility:visible}.ac-admin.stored .ac-right .sidebox.form-actions .submit.save{display:none}.ac-admin.stored .ac-right .sidebox.form-actions .form-reset,.ac-admin.stored .ac-right .sidebox.form-actions .submit.update{display:block}.ac-admin.stored .column-footer .submit.save{display:none}.ac-admin.stored .column-footer .submit.update{display:inline-block}.ac-left .ac-notice{background:#fff;border-left:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin-bottom:15px;padding:1px 12px}.ac-left .ajax-message{display:none}.ac-left .ac-message{margin-top:0!important}.ac-left .ac-boxes .ac-columns form{box-shadow:0 1px 3px rgba(0,0,0,.1);margin:0}.ac-left .ac-boxes.disabled{opacity:.7}.ac-left .ac-boxes.disabled .column_action,.ac-left .ac-boxes.disabled a.clone-button,.ac-left .ac-boxes.disabled a.remove-button{display:none!important}.ac-left .ac-boxes.disabled .column-meta td.column_sort{display:none}.ac-left .ac-boxes.disabled .column-meta td.column_label{padding-left:10px}.ac-left .ac-boxes.disabled .meta span{cursor:default!important;opacity:.45}.ac-left .ac-boxes.disabled .meta span:before{color:gray!important}.ac-left .ac-boxes.disabled .meta span.on{opacity:1}.ac-left .ac-boxes.disabled .column-footer{display:none}.ac-column a{cursor:pointer}.ac-column a:active,.ac-column a:focus{box-shadow:none}.ac-column.loading .ac-column-body>.spinner{position:absolute;left:50%;top:50%;z-index:5;margin-left:-10px;margin-top:-10px;display:block}.ac-column.loading .ac-column-body:before{content:"";position:absolute;width:100%;height:100%;background:#fff;z-index:4;opacity:.5}.ac-column.opened{margin-bottom:-1px}.ac-column.opened .ac-column-header{background-color:#eaeaea;border-color:#ccc}.ac-column.opened .ac-column-header:hover .column_label .inner>a.close-button{display:inline-block}.ac-column.opened .ac-column-header .column_edit:after{content:"\f142"}.ac-column.opened .ac-column-header table td{border-color:#f8f8f8;color:#333;text-shadow:0 1px 0 #fff}.ac-column.opened .ac-column-header table td a{color:#333;text-shadow:0 1px 0 #fff}.ac-column.opened .ac-column-header table td.column_sort span{color:#9b9b9b}.ac-column.opened .ac-column-header table td.column_label .meta span{color:#8d8d8d;text-shadow:none}.ac-column.opened .ac-column-header table td.column_label a.edit-button{display:none}.ac-column.opened .ac-column-header table td.column_type{color:#5c5c5c}.ac-column.opened .ac-column-header table td.column_edit:after{color:#9b9b9b}.ac-column.opened .ac-column-body{border:1px solid #ccc;border-top:1px solid #d4d4d4}.ac-column-setting{width:100%;clear:both;border-spacing:0;margin:0;border-top:1px solid #e8e8e8}.ac-column-setting:first-child{border-top:0}.ac-column-setting tr.hide{display:none}.ac-column-setting tr td{vertical-align:top;border:none;padding:0;background:#fff}.ac-column-setting td.col-label{position:relative;line-height:24px;overflow:visible;background:#f5f5f5;border-right:1px solid #dedede;width:34%;padding:10px;padding-left:12px}.ac-column-setting td.col-label span.label{font-weight:700;display:block;color:#333;font-style:normal}.ac-column-setting td.col-label div.tooltip{font-size:12px;font-style:normal;line-height:16px;margin:0!important;display:none;position:absolute;max-width:200px;z-index:3;top:40px;left:0;font-weight:400;color:#fff;background-color:#333;box-shadow:0 1px 3px rgba(0,0,0,.2);padding:.618em 1em;border-radius:3px}.ac-column-setting td.col-label div.tooltip em{margin-top:3px;display:block;color:#999}.ac-column-setting td.col-input div.msg{margin-top:5px;display:none;color:#333;padding:6px 10px;background-color:#ffebe8;border:1px solid #fff;border-radius:3px}.ac-column-setting td.col-input div.msg p{margin:.5em 0 1em}.ac-column-setting td.col-input div.msg a.button{margin-bottom:1em}.ac-column-setting td.col-input .help-msg{margin:10px 0 0;color:#666;font-size:13px}.ac-column-setting .ac-column-setting td.col_label{background-color:#fcfcfc}.ac-column-setting .ac-column-setting td.col_label .label{font-size:12px;color:#595959}.ac-column-setting span.ac-setting-error{display:block;margin:0;background-color:#ffebe8;padding:7px 10px}.ac-column-setting-actions .col-settings p{padding-left:10px}.ac-column-setting-actions .col-settings a{text-decoration:none}.ac-column-setting-actions .col-settings a.clone-button,.ac-column-setting-actions .col-settings a.close-button{margin-right:10px}.ac-column-setting-actions .col-settings a.remove-button{color:#a00;text-decoration:none;text-shadow:none;margin-right:5px}.ac-column-setting-actions .col-settings a.remove-button:hover{color:red}.ac-setting-input{padding:10px;line-height:24px}.ac-setting-input input,.ac-setting-input select{width:99.95%}.ac-setting-input input[type=checkbox],.ac-setting-input input[type=radio]{width:auto;margin-right:4px}.ac-setting-input .checkbox-labels>label,.ac-setting-input .radio-labels>label{padding-right:10px;vertical-align:top}.ac-setting-input .checkbox-labels.vertical input[type=radio],.ac-setting-input .radio-labels.vertical input[type=radio]{margin-right:6px}.ac-setting-input .checkbox-labels.vertical>label,.ac-setting-input .radio-labels.vertical>label{display:block;margin-bottom:5px}.ac-setting-input-date .ac-setting-input-date__custom{display:inline-block;width:71px;margin-right:5px}.ac-setting-input-date .ac-setting-input-date__value{display:inline-block;width:165px}.ac-setting-input-date .ac-setting-input-date__example{margin-left:8px}.ac-setting-input-date .ac-setting-input-date__example .spinner{float:none;vertical-align:top}.ac-setting-input-date code{display:inline-block;min-width:60px;padding-top:0;padding-bottom:0;text-align:center}.ac-setting-input-width{position:relative}.ac-setting-input-width div.description{font-size:12px;width:68px;position:absolute;display:table}.ac-setting-input-width div.description input{margin:0;text-align:right;vertical-align:middle;display:table-cell}.ac-setting-input-width div.description input::-webkit-input-placeholder{font-size:13px}.ac-setting-input-width div.description input:-moz-placeholder,.ac-setting-input-width div.description input::-moz-placeholder{font-size:13px}.ac-setting-input-width div.description input:-ms-input-placeholder{font-size:13px}.ac-setting-input-width div.description span{background:#efefef;display:table-cell;width:26px;line-height:23px;text-align:center;vertical-align:middle;border:1px solid #dedede;border-left:none;color:#505050}.ac-setting-input-width div.width-slider{margin-left:82px;margin-right:88px;position:relative;top:8px}.ac-setting-input-width div.width-slider .ui-slider-handle{cursor:ew-resize}.ac-setting-input-width div.unit-select{position:absolute;top:11px;right:6px;width:82px;text-align:right}.ac-setting-input-width div.unit-select .radio-labels{padding:0}.ac-setting-input-width div.unit-select .radio-labels label{padding:0;margin-right:6px}.ac-setting-input-width div.unit-select .radio-labels label input{margin-right:2px}.ac-column-header{border-style:solid;border-color:#dfdfdf;border-width:1px 1px 0;background:#fcfcfc}.ac-column-header:nth-child(2n) .column-meta{background:#f9f9f9}.ac-column-header img{margin-right:3px}.ac-column-header table{border:none;background:transparent;border-radius:0}.ac-column-header table tr td{vertical-align:top;height:18px;padding:12px 8px;border-width:1px 0 0;border-style:solid;border-color:transparent}.ac-column-header table tr td.column_sort{position:relative;cursor:move;padding:9px 16px}.ac-column-header table tr td.column_sort span.cpacicon-move{position:absolute;top:12px;left:12px;font-size:22px;display:inline-block;color:#bdbdbd}.ac-column-header table tr td.column_label{width:70%;font-weight:700;vertical-align:middle;position:relative;padding:15px 0}.ac-column-header table tr td.column_label .inner{position:relative;overflow:hidden;height:18px}.ac-column-header table tr td.column_label .inner .toggle img{max-height:20px}.ac-column-header table tr td.column_label .inner>a{color:#5a5a5a;padding:0 4px}.ac-column-header table tr td.column_label .inner>a:hover{color:#333}.ac-column-header table tr td.column_label .inner>a.clone-button,.ac-column-header table tr td.column_label .inner>a.close-button,.ac-column-header table tr td.column_label .inner>a.edit-button,.ac-column-header table tr td.column_label .inner>a.remove-button{display:none;color:#0074a2;text-decoration:none;text-shadow:none;font-weight:400;margin-left:5px;font-size:12px}.ac-column-header table tr td.column_label .inner>a.clone-button:hover,.ac-column-header table tr td.column_label .inner>a.close-button:hover,.ac-column-header table tr td.column_label .inner>a.edit-button:hover,.ac-column-header table tr td.column_label .inner>a.remove-button:hover{color:#2ea2cc}.ac-column-header table tr td.column_label .inner>a.remove-button{color:#a00}.ac-column-header table tr td.column_label .inner>a.remove-button:hover{color:red}.ac-column-header table tr td.column_label .inner .meta{display:inline-block;float:right;font-weight:400;color:#b2b2b2;font-size:12px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting{cursor:pointer;margin-left:4px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-heading-setting--width{margin-right:3px;cursor:auto;color:#737373}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator{margin-left:3px;font-size:24px;line-height:17px;width:22px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator.ac-column-indicator--filter{font-size:20px}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator.on,.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.ac-column-indicator.on span{color:#21759b}.ac-column-header table tr td.column_label .inner .meta .ac-column-heading-setting.disabled{cursor:default}.ac-column-header table tr td.column_type{width:auto;min-width:120px;text-align:right;color:#999;padding-right:0}.ac-column-header table tr td.column_type .inner{display:inline-block;height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:120px;vertical-align:middle}.ac-column-header table tr td.column_type .inner a{margin-top:2px;color:#999}.ac-column-header table tr td.column_edit{width:38px;min-width:38px;text-align:center;cursor:pointer}.ac-column-header table tr td.column_edit:after{right:0;content:"\f140";font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0 5px 0 0;bottom:0;position:relative;vertical-align:bottom;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#b4b9be}.ac-column-header table tr:hover td.column_sort span{color:#9b9b9b}.ac-column-header:hover .column_label .inner>a.clone-button,.ac-column-header:hover .column_label .inner>a.edit-button,.ac-column-header:hover .column_label .inner>a.remove-button{display:inline-block}.ac-column-header span.vers{padding-top:2px}.ac-column-body{display:none;border-width:1px 1px 0;border-style:solid;border-color:#dfdfdf;position:relative}.column-footer{background:#eaf2fa;border:1px solid #c7d7e2;min-height:26px;padding:8px;overflow:hidden}.column-footer .order-message{background:transparent url(../images/order_arrow.png) no-repeat 0 0;color:#7a9bbe;float:left;font-family:Comic Sans MS,sans-serif;font-size:11px;height:13px;line-height:1em;margin-left:4px;padding:7px 0 0 22px;text-shadow:0 1px 0 #fff;display:inline-block}.column-footer .button-container{float:right;display:inline-block;min-height:29px}.column-footer .button-container a{display:inline-block;margin-left:5px;vertical-align:top}.column-footer .button-container a.clear-columns{color:#bc0b0b;text-decoration:none;margin-right:8px;margin-top:5px}.column-footer .button-container a.clear-columns:hover{color:red}.ac-right .sidebox{background:none repeat scroll 0 0 #fff;border:1px solid #dedede;border-radius:0 0 0 0;box-shadow:0 1px 3px rgba(0,0,0,.1);position:relative;margin-bottom:14px}.ac-right .sidebox h3{padding:10px;margin:0;position:relative}.ac-right .sidebox h3.title{font-family:Georgia,Times New Roman,Bitstream Charter,Times,serif;font-size:15px;font-weight:400;line-height:1;margin:0;padding:7px 10px;background:#f1f1f1;background-image:linear-gradient(0deg,#ececec,#f9f9f9);border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;box-shadow:0 1px 0 #fff;border-bottom-style:solid;border-bottom-width:1px}.ac-right .sidebox h3 span.left{position:relative;background:#fff;z-index:2;padding-right:8px;float:none}.ac-right .sidebox h3 span.contenttype{display:block;line-height:20px;font-size:12px;text-transform:uppercase;color:gray;margin-top:4px}.ac-right .sidebox h3 span.contenttype.right{position:absolute;display:inline-block;z-index:1;right:10px;text-align:right;margin-top:0}.ac-right .sidebox .inside{padding:10px}.ac-right .sidebox .inside p{margin-top:0}.ac-right .sidebox.form-actions .form-reset{display:none;border-bottom:1px solid #f5f5f5;padding:8px}.ac-right .sidebox.form-actions .reset-column-type{text-decoration:none;color:#bc0b0b;line-height:25px;display:inline-block;background:none;border:none;padding:0;font-size:13px;cursor:pointer;margin:0}.ac-right .sidebox.form-actions .reset-column-type:hover{color:red}.ac-right .sidebox.form-actions .form-update{padding:8px;overflow:hidden}.ac-right .sidebox.form-actions .submit{display:none;width:100%;height:28px;line-height:28px;text-align:center}.ac-right .sidebox.form-actions .submit.save{display:block}.ac-right .sidebox#direct-feedback #feedback-rate,.ac-right .sidebox#direct-feedback #feedback-support{display:none}.ac-right .sidebox#direct-feedback .inside>a{border-radius:4px;border:1px solid #ccc;width:48%;height:64px;text-align:center;line-height:64px;font-weight:700;color:#222;display:inline-block;text-decoration:none}.ac-right .sidebox#direct-feedback .inside>a:hover{background:#fafafa}.ac-right .sidebox#direct-feedback .inside form textarea{width:100%;height:120px}.ac-right .sidebox#direct-feedback .inside form input[type=submit]{display:inline-block;float:right;border-radius:4px;border:1px solid #ccc;height:32px;text-align:center;line-height:32px;font-weight:700;font-size:12px;padding:0 32px;color:#ccc;background:none;text-decoration:none;cursor:pointer}.ac-right .sidebox#direct-feedback .inside form input[type=submit]:hover{background:#fafafa}.ac-right .sidebox#direct-feedback .inside form p.description{float:left;font-size:10px}.ac-right .sidebox#direct-feedback .inside ul{margin:0}.ac-right .sidebox#direct-feedback .inside ul.share li{margin:0;display:block;float:left;margin-left:9px;width:30%}.ac-right .sidebox#direct-feedback .inside ul.share li a{text-decoration:none;vertical-align:middle;line-height:20px;padding:16px 0;width:100%;text-align:center;border:1px solid #ccc;border-radius:4px;display:block}.ac-right .sidebox#direct-feedback .inside ul.share li a:hover{background:#fafafa}.ac-right .sidebox#direct-feedback .inside ul.share li:first-child{margin-left:0}.ac-right .sidebox#direct-feedback #feedback-support .inside ul.share li{width:48%}#ac-pro-version{background:none}#ac-pro-version .padding-box{padding:20px 10px 10px;background:#3d4350;color:#fff}#ac-pro-version .nopadding{margin:0;padding:0}#ac-pro-version h2{color:#fff}#ac-pro-version h3{font-size:34px;line-height:40px}#ac-pro-version h3 a{text-decoration:none;color:#fff}#ac-pro-version h3 a span{color:#e9426e}#ac-pro-version sup{text-decoration:line-through;font-size:13px;color:#ccc}#ac-pro-version .ac-pro-prices{color:#ffcac0;text-decoration:none}#ac-pro-version .ac-pro-prices:hover{text-decoration:underline}#ac-pro-version .ac-pro-prices:hover sup{text-decoration:none}#ac-pro-version .acp-button{cursor:pointer}#ac-pro-version .more{color:#ffee85;text-decoration:none}#ac-pro-version .more:hover{text-decoration:underline}#ac-pro-version p.center{text-align:center}#ac-pro-version p.nomargin{margin-bottom:0}#ac-pro-version ul.features a:hover{text-decoration:underline}#ac-pro-version ul li{padding-bottom:3px}#ac-pro-version ul li a{color:#fff;text-decoration:none;padding-left:25px;position:relative;display:block}#ac-pro-version ul li a:before{content:"\2713";font-weight:700;font-size:16px;position:absolute;left:0;top:0}#ac-pro-version ul li.acp-integration{padding:0;min-height:23px;line-height:23px}#ac-pro-version ul li.acp-integration img{height:23px;display:inline-block;vertical-align:middle;margin-right:3px}#ac-pro-version ul li.acp-integration img.ac-addon-pods{margin-top:-4px}#ac-pro-version ul li.acp-integration img.ac-addon-types{height:18px}#ac-pro-version ul li.acp-integration img.cac-addon-acf{margin-top:-4px;height:15px}#ac-pro-version ul li.acp-integration a:before{content:"+"}#ac-pro-version .padding-box.ac-pro-deal{color:#3d4350;padding-bottom:20px;text-align:center;background:#ffef8f}#ac-pro-version .padding-box.ac-pro-deal h3{font-size:20px;line-height:26px;padding-top:0;padding-bottom:0;margin-bottom:18px}#ac-pro-version .padding-box.ac-pro-deal a.acp-button{font-size:16px}#ac-pro-version .padding-box.ac-pro-newsletter{background:#fff;color:#3d4350}#ac-pro-version .padding-box.ac-pro-newsletter h3{font-size:20px;padding-bottom:0}#ac-pro-version .padding-box.ac-pro-newsletter input{width:100%;margin-bottom:8px}#ac-pro-version .padding-box.ac-pro-newsletter .acp-button{margin-top:12px;margin-bottom:0;padding:7px 20px}#ac-pro-version .acp-button{background:#e9426e;border:none;color:#fff;text-decoration:none;text-align:center;display:block;padding:6px 20px;border-radius:3px}@media only screen and (max-width:900px){.ac-admin{margin-right:0}.ac-admin .ac-left,.ac-admin .menu{float:none}.ac-admin .ac-right{float:none;margin-top:0;margin-right:0;width:100%}}
classes/API.php CHANGED
@@ -60,7 +60,6 @@ class AC_API {
60
61
if ( ! $columndata ) {
62
return array();
63
-
64
}
65
66
$layouts = array();
60
61
if ( ! $columndata ) {
62
return array();
63
}
64
65
$layouts = array();
classes/Admin/Addons.php CHANGED
@@ -99,7 +99,7 @@ class AC_Admin_Addons {
99
* Register addon
100
*/
101
private function set_addons() {
102
- $classes = AC()->autoloader()->get_class_names_from_dir( AC()->get_plugin_dir() . 'classes/Admin/Addon', 'AC_' );
103
104
foreach ( $classes as $class ) {
105
$this->register_addon( new $class );
99
* Register addon
100
*/
101
private function set_addons() {
102
+ $classes = AC()->autoloader()->get_class_names_from_dir( AC()->get_plugin_dir() . 'classes/Admin/Addon', AC()->get_prefix() );
103
104
foreach ( $classes as $class ) {
105
$this->register_addon( new $class );
classes/Admin/Page/Columns.php CHANGED
@@ -112,7 +112,7 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
112
113
// Load table headers
114
if ( ! $list_screen->get_original_columns() ) {
115
- $this->set_original_table_headers( $list_screen );
116
}
117
118
$this->preferences()->set( 'list_screen', $list_screen->get_key() );
@@ -129,21 +129,6 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
129
return $this->current_list_screen;
130
}
131
132
- /**
133
- * Populate the list screen with columns headers from WP_List_Table
134
- *
135
- * @see WP_List_Table::get_columns()
136
- *
137
- * @param AC_ListScreen $list_screen
138
- */
139
- private function set_original_table_headers( AC_ListScreen $list_screen ) {
140
- $list_screen->get_list_table();
141
-
142
- $table_headers = (array) get_column_headers( $list_screen->get_screen_id() );
143
-
144
- $list_screen->set_original_columns( $table_headers );
145
- }
146
-
147
/**
148
* Handle request
149
*/
@@ -410,7 +395,7 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
410
* @return AC_Admin_Promo|false
411
*/
412
public function get_active_promotion() {
413
- $classes = AC()->autoloader()->get_class_names_from_dir( AC()->get_plugin_dir() . 'classes/Admin/Promo', 'AC_' );
414
415
foreach ( $classes as $class ) {
416
@@ -785,22 +770,47 @@ class AC_Admin_Page_Columns extends AC_Admin_Page {
785
}
786
787
/**
788
- * Get first custom group column
789
*/
790
- private function display_column_template( AC_ListScreen $list_screen ) {
791
$columns = array();
792
793
- foreach ( $list_screen->get_column_types() as $column_type ) {
794
- if ( 'custom' === $column_type->get_group() ) {
795
$columns[ $column_type->get_label() ] = $column_type;
796
}
797
}
798
799
array_multisort( array_keys( $columns ), SORT_NATURAL, $columns );
800
801
- /** @var AC_Column $column */
802
$column = array_shift( $columns );
803
804
$this->display_column( $column );
805
}
806
112
113
// Load table headers
114
if ( ! $list_screen->get_original_columns() ) {
115
+ $list_screen->set_original_columns( $list_screen->get_default_column_headers() );
116
}
117
118
$this->preferences()->set( 'list_screen', $list_screen->get_key() );
129
return $this->current_list_screen;
130
}
131
132
/**
133
* Handle request
134
*/
395
* @return AC_Admin_Promo|false
396
*/
397
public function get_active_promotion() {
398
+ $classes = AC()->autoloader()->get_class_names_from_dir( AC()->get_plugin_dir() . 'classes/Admin/Promo', AC()->get_prefix() );
399
400
foreach ( $classes as $class ) {
401
770
}
771
772
/**
773
+ * @param AC_ListScreen $list_screen
774
+ * @param string $group
775
+ *
776
+ * @return AC_Column|false
777
*/
778
+ private function get_column_template_by_group( AC_ListScreen $list_screen, $group = false ) {
779
+ $types = $list_screen->get_column_types();
780
+
781
+ if ( ! $group ) {
782
+ return array_shift( $types );
783
+ }
784
+
785
$columns = array();
786
787
+ foreach ( $types as $column_type ) {
788
+ if ( $group === $column_type->get_group() ) {
789
$columns[ $column_type->get_label() ] = $column_type;
790
}
791
}
792
793
array_multisort( array_keys( $columns ), SORT_NATURAL, $columns );
794
795
$column = array_shift( $columns );
796
797
+ if ( ! $column ) {
798
+ return false;
799
+ }
800
+
801
+ return $column;
802
+ }
803
+
804
+ /**
805
+ * Get first custom group column
806
+ */
807
+ private function display_column_template( AC_ListScreen $list_screen ) {
808
+ $column = $this->get_column_template_by_group( $list_screen, 'custom' );
809
+
810
+ if ( ! $column ) {
811
+ $column = $this->get_column_template_by_group( $list_screen );
812
+ }
813
+
814
$this->display_column( $column );
815
}
816
classes/Column.php CHANGED
@@ -136,7 +136,7 @@ class AC_Column {
136
* @return $this
137
*/
138
public function set_label( $label ) {
139
- $this->label = (string) $label;
140
141
return $this;
142
}
@@ -378,28 +378,6 @@ class AC_Column {
378
return $value;
379
}
380
381
- /**
382
- * True when the column is sortable by default
383
- *
384
- * return bool
385
- */
386
- public function is_native_sortable() {
387
- if ( ! $this->is_original() ) {
388
- return false;
389
- }
390
-
391
- $table = $this->get_list_screen()->get_list_table();
392
-
393
- if ( ! $table instanceof WP_List_Table ) {
394
- return false;
395
- }
396
-
397
- $column_info = $table->get_column_info();
398
- $sortables = $column_info[2];
399
-
400
- return isset( $sortables[ $this->get_type() ] );
401
- }
402
-
403
/**
404
* Get the raw, underlying value for the column
405
* Not suitable for direct display, use get_value() for that
136
* @return $this
137
*/
138
public function set_label( $label ) {
139
+ $this->label = $label;
140
141
return $this;
142
}
378
return $value;
379
}
380
381
/**
382
* Get the raw, underlying value for the column
383
* Not suitable for direct display, use get_value() for that
classes/Column/Comment/AuthorAvatar.php CHANGED
@@ -17,7 +17,7 @@ class AC_Column_Comment_AuthorAvatar extends AC_Column {
17
public function get_value( $id ) {
18
$comment = get_comment( $id );
19
20
- return get_avatar( $comment, 80 );
21
}
22
23
}
17
public function get_value( $id ) {
18
$comment = get_comment( $id );
19
20
+ return get_avatar( $comment, 60 );
21
}
22
23
}
classes/Column/Comment/User.php CHANGED
@@ -14,6 +14,12 @@ class AC_Column_Comment_User extends AC_Column {
14
$this->set_label( __( 'User', 'codepress-admin-columns' ) );
15
}
16
17
/**
18
* @param int $comment_id Comment ID
19
*
14
$this->set_label( __( 'User', 'codepress-admin-columns' ) );
15
}
16
17
+ public function get_value( $id ) {
18
+ $raw_value = $this->get_raw_value( $id );
19
+
20
+ return $this->get_formatted_value( $raw_value, $raw_value );
21
+ }
22
+
23
/**
24
* @param int $comment_id Comment ID
25
*
classes/Column/Post/AuthorName.php CHANGED
@@ -17,6 +17,12 @@ class AC_Column_Post_AuthorName extends AC_Column {
17
$this->set_label( __( 'Author', 'codepress-admin-columns' ) );
18
}
19
20
public function get_raw_value( $post_id ) {
21
return $this->get_post_author( $post_id );
22
}
17
$this->set_label( __( 'Author', 'codepress-admin-columns' ) );
18
}
19
20
+ public function get_value( $id ) {
21
+ $user_id = $this->get_raw_value( $id );
22
+
23
+ return $this->get_formatted_value( $user_id, $user_id );
24
+ }
25
+
26
public function get_raw_value( $post_id ) {
27
return $this->get_post_author( $post_id );
28
}
classes/Column/Post/FeaturedImage.php CHANGED
@@ -14,23 +14,15 @@ class AC_Column_Post_FeaturedImage extends AC_Column_Meta {
14
$this->set_label( __( 'Featured Image', 'codepress-admin-columns' ) );
15
}
16
17
- // Meta
18
-
19
public function get_meta_key() {
20
return '_thumbnail_id';
21
}
22
23
- // Display
24
-
25
- public function get_value( $post_id ) {
26
- $value = parent::get_value( $post_id );
27
28
if ( ! $value ) {
29
- return false;
30
- }
31
-
32
- if ( $link = get_edit_post_link( $post_id ) ) {
33
- $value = ac_helper()->html->link( $link . '#postimagediv', $value );
34
}
35
36
return $value;
14
$this->set_label( __( 'Featured Image', 'codepress-admin-columns' ) );
15
}
16
17
public function get_meta_key() {
18
return '_thumbnail_id';
19
}
20
21
+ public function get_value( $id ) {
22
+ $value = parent::get_value( $id );
23
24
if ( ! $value ) {
25
+ return $this->get_empty_char();
26
}
27
28
return $value;
classes/Column/Post/LastModifiedAuthor.php CHANGED
@@ -17,6 +17,16 @@ class AC_Column_Post_LastModifiedAuthor extends AC_Column_Meta {
17
$this->set_label( __( 'Last Modified Author', 'codepress-admin-columns' ) );
18
}
19
20
public function get_meta_key() {
21
return '_edit_last';
22
}
17
$this->set_label( __( 'Last Modified Author', 'codepress-admin-columns' ) );
18
}
19
20
+ public function get_value( $id ) {
21
+ $raw_value = $this->get_raw_value( $id );
22
+
23
+ if( ! $raw_value ){
24
+ return $this->get_empty_char();
25
+ }
26
+
27
+ return $this->get_formatted_value( $raw_value, $raw_value );
28
+ }
29
+
30
public function get_meta_key() {
31
return '_edit_last';
32
}
classes/Column/User/CommentCount.php CHANGED
@@ -14,10 +14,6 @@ class AC_Column_User_CommentCount extends AC_Column {
14
$this->set_label( __( 'Comment Count', 'codepress-admin-columns' ) );
15
}
16
17
- public function get_value( $user_id ) {
18
- return $this->get_raw_value( $user_id );
19
- }
20
-
21
public function get_raw_value( $user_id ) {
22
return get_comments( array(
23
'user_id' => $user_id,
14
$this->set_label( __( 'Comment Count', 'codepress-admin-columns' ) );
15
}
16
17
public function get_raw_value( $user_id ) {
18
return get_comments( array(
19
'user_id' => $user_id,
classes/Column/User/FirstName.php CHANGED
@@ -19,7 +19,13 @@ class AC_Column_User_FirstName extends AC_Column_Meta {
19
}
20
21
public function get_value( $user_id ) {
22
- return $this->get_raw_value( $user_id );
23
}
24
25
public function get_raw_value( $user_id ) {
19
}
20
21
public function get_value( $user_id ) {
22
+ $value = $this->get_raw_value( $user_id );
23
+
24
+ if ( ! $value ) {
25
+ return $this->get_empty_char();
26
+ }
27
+
28
+ return $value;
29
}
30
31
public function get_raw_value( $user_id ) {
classes/Column/User/LastName.php CHANGED
@@ -19,7 +19,13 @@ class AC_Column_User_LastName extends AC_Column_Meta {
19
}
20
21
public function get_value( $user_id ) {
22
- return $this->get_raw_value( $user_id );
23
}
24
25
public function get_raw_value( $user_id ) {
19
}
20
21
public function get_value( $user_id ) {
22
+ $value = $this->get_raw_value( $user_id );
23
+
24
+ if ( ! $value ) {
25
+ return $this->get_empty_char();
26
+ }
27
+
28
+ return $value;
29
}
30
31
public function get_raw_value( $user_id ) {
classes/{Settings/Form → Form}/Element.php RENAMED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
exit;
5
}
6
7
- abstract class AC_Settings_Form_Element {
8
9
/**
10
* @var array
4
exit;
5
}
6
7
+ abstract class AC_Form_Element {
8
9
/**
10
* @var array
classes/{Settings/Form → Form}/Element/Checkbox.php RENAMED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
exit;
5
}
6
7
- class AC_Settings_Form_Element_Checkbox extends AC_Settings_Form_Element {
8
9
/**
10
* @var bool
@@ -57,7 +57,7 @@ class AC_Settings_Form_Element_Checkbox extends AC_Settings_Form_Element {
57
$value = (array) $this->get_value();
58
59
foreach ( $options as $key => $label ) {
60
- $input = new AC_Settings_Form_Element_Input( $this->get_name() );
61
62
$input->set_value( $key )
63
->set_type( $this->get_type() )
4
exit;
5
}
6
7
+ class AC_Form_Element_Checkbox extends AC_Form_Element {
8
9
/**
10
* @var bool
57
$value = (array) $this->get_value();
58
59
foreach ( $options as $key => $label ) {
60
+ $input = new AC_Form_Element_Input( $this->get_name() );
61
62
$input->set_value( $key )
63
->set_type( $this->get_type() )
classes/{Settings/Form → Form}/Element/Input.php RENAMED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
exit;
5
}
6
7
- class AC_Settings_Form_Element_Input extends AC_Settings_Form_Element {
8
9
protected function is_valid_type( $type ) {
10
$valid_types = array(
4
exit;
5
}
6
7
+ class AC_Form_Element_Input extends AC_Form_Element {
8
9
protected function is_valid_type( $type ) {
10
$valid_types = array(
classes/{Settings/Form → Form}/Element/Radio.php RENAMED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
exit;
5
}
6
7
- class AC_Settings_Form_Element_Radio extends AC_Settings_Form_Element_Checkbox {
8
9
protected function get_type() {
10
return 'radio';
4
exit;
5
}
6
7
+ class AC_Form_Element_Radio extends AC_Form_Element_Checkbox {
8
9
protected function get_type() {
10
return 'radio';
classes/Form/Element/Select.php ADDED
@@ -0,0 +1,100 @@
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ class AC_Form_Element_Select extends AC_Form_Element {
8
+
9
+ /**
10
+ * @var string
11
+ */
12
+ protected $no_result = '';
13
+
14
+ protected function render_options( array $options ) {
15
+ $output = array();
16
+
17
+ foreach ( $options as $key => $option ) {
18
+ if ( isset( $option['options'] ) && is_array( $option['options'] ) ) {
19
+ $output[] = $this->render_optgroup( $option );
20
+
21
+ continue;
22
+ }
23
+
24
+ $output[] = $this->render_option( $key, $option );
25
+ }
26
+
27
+ return implode( "\n", $output );
28
+ }
29
+
30
+ protected function render_option( $key, $label ) {
31
+ $template = '<option %s>%s</option>';
32
+ $attributes = $this->get_option_attributes( $key );
33
+
34
+ return sprintf( $template, $this->get_attributes_as_string( $attributes ), esc_html( $label ) );
35
+ }
36
+
37
+ protected function get_option_attributes( $key ) {
38
+ $attributes = array();
39
+ $attributes['value'] = $key;
40
+
41
+ if ( selected( $this->get_value(), $key, false ) ) {
42
+ $attributes['selected'] = 'selected';
43
+ }
44
+
45
+ return $attributes;
46
+ }
47
+
48
+ /**
49
+ * @param array $group
50
+ *
51
+ * @return string
52
+ */
53
+ protected function render_optgroup( array $group ) {
54
+ $template = '<optgroup %s>%s</optgroup>';
55
+ $attributes = array();
56
+
57
+ if ( isset( $group['title'] ) ) {
58
+ $attributes['label'] = esc_attr( $group['title'] );
59
+ }
60
+
61
+ return sprintf( $template, $this->get_attributes_as_string( $attributes ), $this->render_options( $group['options'] ) );
62
+ }
63
+
64
+ public function render() {
65
+ if ( ! $this->get_options() ) {
66
+ return $this->get_no_result();
67
+ }
68
+
69
+ $template = '
70
+ <select %s>
71
+ %s
72
+ </select>
73
+ %s';
74
+
75
+ $attributes = $this->get_attributes();
76
+ $attributes['name'] = $this->get_name();
77
+ $attributes['id'] = $this->get_id();
78
+
79
+ return sprintf( $template, $this->get_attributes_as_string( $attributes ), $this->render_options( $this->get_options() ), $this->render_description() );
80
+ }
81
+
82
+ /**
83
+ * @return string
84
+ */
85
+ public function get_no_result() {
86
+ return $this->no_result;
87
+ }
88
+
89
+ /**
90
+ * @param string $no_result
91
+ *
92
+ * @return $this
93
+ */
94
+ public function set_no_result( $no_result ) {
95
+ $this->no_result = (string) $no_result;
96
+
97
+ return $this;
98
+ }
99
+
100
+ }
classes/Helper/Html.php CHANGED
@@ -209,6 +209,10 @@ class AC_Helper_Html {
209
/** @var DOMElement $link */
210
$href = $link->getAttribute( 'href' );
211
212
$internal = false;
213
214
foreach ( (array) $internal_domains as $domain ) {
@@ -467,6 +471,10 @@ class AC_Helper_Html {
467
* @return string
468
*/
469
public function images( $value, $removed = false ) {
470
if ( $removed ) {
471
$value .= ac_helper()->html->rounded( '+' . $removed );
472
}
209
/** @var DOMElement $link */
210
$href = $link->getAttribute( 'href' );
211
212
+ if ( 0 === strpos( $href, '#' ) ) {
213
+ continue;
214
+ }
215
+
216
$internal = false;
217
218
foreach ( (array) $internal_domains as $domain ) {
471
* @return string
472
*/
473
public function images( $value, $removed = false ) {
474
+ if ( ! $value ) {
475
+ return false;
476
+ }
477
+
478
if ( $removed ) {
479
$value .= ac_helper()->html->rounded( '+' . $removed );
480
}
classes/Helper/Icon.php CHANGED
@@ -37,6 +37,11 @@ class AC_Helper_Icon {
37
38
/**
39
* @since 3.0
40
* @return string
41
*/
42
public function yes( $tooltip = false, $title = true, $class = 'green' ) {
37
38
/**
39
* @since 3.0
40
+ *
41
+ * @param string $tooltip
42
+ * @param string $title
43
+ * @param string $class
44
+ *
45
* @return string
46
*/
47
public function yes( $tooltip = false, $title = true, $class = 'green' ) {
classes/Helper/Image.php CHANGED
@@ -108,7 +108,7 @@ class AC_Helper_Image {
108
* @return string
109
*/
110
public function get_image_by_url( $url, $size ) {
111
- $dimensions = array( 80, 80 );
112
113
if ( is_string( $size ) && ( $sizes = $this->get_image_sizes_by_name( $size ) ) ) {
114
$dimensions = array( $sizes['width'], $sizes['height'] );
108
* @return string
109
*/
110
public function get_image_by_url( $url, $size ) {
111
+ $dimensions = array( 60, 60 );
112
113
if ( is_string( $size ) && ( $sizes = $this->get_image_sizes_by_name( $size ) ) ) {
114
$dimensions = array( $sizes['width'], $sizes['height'] );
classes/ListScreen.php CHANGED
@@ -49,14 +49,6 @@ abstract class AC_ListScreen {
49
*/
50
private $page;
51
52
- /**
53
- * Class name of the WP_List_Table instance
54
- * @see WP_List_Table
55
- * @since 3.0
56
- * @var string
57
- */
58
- private $list_table_class;
59
-
60
/**
61
* Group slug. Used for menu.
62
* @var string
@@ -206,14 +198,6 @@ abstract class AC_ListScreen {
206
$this->group = $group;
207
}
208
209
- public function get_list_table_class() {
210
- return $this->list_table_class;
211
- }
212
-
213
- protected function set_list_table_class( $list_table_class ) {
214
- $this->list_table_class = $list_table_class;
215
- }
216
-
217
/**
218
* @return string
219
*/
@@ -254,16 +238,6 @@ abstract class AC_ListScreen {
254
return $this;
255
}
256
257
- /**
258
- * Return a single object based on it's ID (post, user, comment etc.)
259
- *
260
- * @since 3.0
261
- * @return mixed
262
- */
263
- protected function get_object_by_id( $id ) {
264
- return null;
265
- }
266
-
267
/**
268
* ID attribute of targeted list table
269
*
@@ -449,17 +423,6 @@ abstract class AC_ListScreen {
449
450
$this->column_types[ $column->get_type() ] = $column;
451
452
- /**
453
- * Fires when a column type is registered to a list screen. Can be used to attach additional
454
- * functionality to a column type, such as exporting, sorting or filtering
455
- *
456
- * @since 3.0.5
457
- *
458
- * @param AC_Column $column Column type object
459
- * @param AC_ListScreen $list_screen List screen object to which the column was registered
460
- */
461
- do_action( 'ac/list_screen/column_type_registered', $column, $this );
462
-
463
return true;
464
}
465
@@ -541,6 +504,9 @@ abstract class AC_ListScreen {
541
* @param AC_ListScreen $this
542
*/
543
do_action( 'ac/column_types', $this );
544
}
545
546
/**
@@ -805,6 +771,17 @@ abstract class AC_ListScreen {
805
* @return bool
806
*/
807
public function delete() {
808
return delete_option( self::OPTIONS_KEY . $this->get_storage_key() );
809
}
810
@@ -844,34 +821,23 @@ abstract class AC_ListScreen {
844
}
845
846
/**
847
- * Get a single row from list table
848
*
849
- * @since 3.0
850
*/
851
- public function get_single_row( $object_id ) {
852
- ob_start();
853
-
854
- $this->get_list_table()->single_row( $this->get_object_by_id( $object_id ) );
855
-
856
- return ob_get_clean();
857
}
858
859
/**
860
- * get_object_by_id made 'public' for backwards compatibility
861
*
862
- * @param int $object_id
863
*
864
- * @return mixed
865
- */
866
- public function get_object( $object_id ) {
867
- return $this->get_object_by_id( $object_id );
868
- }
869
-
870
- /**
871
- * @return WP_List_Table|object
872
*/
873
- public function get_list_table() {
874
- return _get_list_table( $this->get_list_table_class(), array( 'screen' => $this->get_screen_id() ) );
875
}
876
877
}
49
*/
50
private $page;
51
52
/**
53
* Group slug. Used for menu.
54
* @var string
198
$this->group = $group;
199
}
200
201
/**
202
* @return string
203
*/
238
return $this;
239
}
240
241
/**
242
* ID attribute of targeted list table
243
*
423
424
$this->column_types[ $column->get_type() ] = $column;
425
426
return true;
427
}
428
504
* @param AC_ListScreen $this
505
*/
506
do_action( 'ac/column_types', $this );
507
+
508
+ // For backwards compatibility
509
+ do_action( 'acp/column_types', $this );
510
}
511
512
/**
771
* @return bool
772
*/
773
public function delete() {
774
+
775
+ /**
776
+ * Fires before a column setup is removed from the database
777
+ * Primarily used when columns are deleted through the Admin Columns settings screen
778
+ *
779
+ * @since 3.0.8
780
+ *
781
+ * @param AC_ListScreen $list_screen
782
+ */
783
+ do_action( 'ac/columns_delete', $this );
784
+
785
return delete_option( self::OPTIONS_KEY . $this->get_storage_key() );
786
}
787
821
}
822
823
/**
824
+ * Get default column headers
825
*
826
+ * @return array
827
*/
828
+ public function get_default_column_headers() {
829
+ return array();
830
}
831
832
/**
833
+ * Get the default sortable column. The format is: 'orderby' or [ 'orderby', true ]
834
*
835
+ * The second format will make the initial sorting order be descending
836
*
837
+ * @return array [ $column_name, $descending ]
838
*/
839
+ public function get_default_orderby() {
840
+ return array();
841
}
842
843
}
classes/ListScreen/Comment.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
/**
8
* @since 2.0
9
*/
10
- class AC_ListScreen_Comment extends AC_ListScreen {
11
12
public function __construct() {
13
@@ -18,13 +18,24 @@ class AC_ListScreen_Comment extends AC_ListScreen {
18
$this->set_key( 'wp-comments' );
19
$this->set_screen_id( 'edit-comments' );
20
$this->set_group( 'comment' );
21
22
- /* @see WP_Comments_List_Table */
23
- $this->set_list_table_class( 'WP_Comments_List_Table' );
24
}
25
26
public function get_list_table() {
27
- $table = parent::get_list_table();
28
29
// Since 4.4 the `floated_admin_avatar` filter is added in the constructor of the `WP_Comments_List_Table` class.
30
// Here we remove the filter from the constructor.
@@ -44,14 +55,6 @@ class AC_ListScreen_Comment extends AC_ListScreen {
44
return '#the-comment-list';
45
}
46
47
- /**
48
- * @since 3.0
49
- * @return WP_Comment Comment
50
- */
51
- protected function get_object_by_id( $comment_id ) {
52
- return get_comment( $comment_id );
53
- }
54
-
55
/**
56
* @param string $column_name
57
* @param int $id
@@ -60,12 +63,22 @@ class AC_ListScreen_Comment extends AC_ListScreen {
60
echo $this->get_display_value_by_column_name( $column_name, $id );
61
}
62
63
protected function register_column_types() {
64
$this->register_column_type( new AC_Column_CustomField );
65
$this->register_column_type( new AC_Column_Menu );
66
$this->register_column_type( new AC_Column_Actions );
67
68
- $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/Comment', 'AC_' );
69
}
70
71
}
7
/**
8
* @since 2.0
9
*/
10
+ class AC_ListScreen_Comment extends AC_ListScreenWP {
11
12
public function __construct() {
13
18
$this->set_key( 'wp-comments' );
19
$this->set_screen_id( 'edit-comments' );
20
$this->set_group( 'comment' );
21
+ }
22
23
+ /**
24
+ * @param int $id
25
+ *
26
+ * @return WP_Comment
27
+ */
28
+ protected function get_object( $id ) {
29
+ return get_comment( $id );
30
}
31
32
+ /**
33
+ * @return WP_Comments_List_Table
34
+ */
35
public function get_list_table() {
36
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php' );
37
+
38
+ $table = new WP_Comments_List_Table( array( 'screen' => $this->get_screen_id() ) );
39
40
// Since 4.4 the `floated_admin_avatar` filter is added in the constructor of the `WP_Comments_List_Table` class.
41
// Here we remove the filter from the constructor.
55
return '#the-comment-list';
56
}
57
58
/**
59
* @param string $column_name
60
* @param int $id
63
echo $this->get_display_value_by_column_name( $column_name, $id );
64
}
65
66
+ /**
67
+ * Register column types
68
+ */
69
protected function register_column_types() {
70
$this->register_column_type( new AC_Column_CustomField );
71
$this->register_column_type( new AC_Column_Menu );
72
$this->register_column_type( new AC_Column_Actions );
73
74
+ $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/Comment', AC()->get_prefix() );
75
+ }
76
+
77
+ /**
78
+ * @return array
79
+ */
80
+ public function get_default_orderby() {
81
+ return array( 'comment_date', true );
82
}
83
84
}
classes/ListScreen/Link.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- class AC_ListScreen_Link extends AC_ListScreen {
8
-
9
- public function __construct() {
10
-
11
- $this->set_label( __( 'Links' ) );
12
- $this->set_singular_label( __( 'Link' ) );
13
- $this->set_screen_base( 'link-manager' );
14
- $this->set_key( 'wp-links' );
15
- $this->set_screen_id( 'link-manager' );
16
- $this->set_group( 'link' );
17
-
18
- /* @see WP_Links_List_Table */
19
- $this->set_list_table_class( 'WP_Links_List_Table' );
20
- }
21
-
22
- public function set_manage_value_callback() {
23
- add_action( 'manage_link_custom_column', array( $this, 'manage_value' ), 100, 2 );
24
- }
25
-
26
- /**
27
- * @since 3.0
28
- * @return stdClass
29
- */
30
- protected function get_object_by_id( $bookmark_id ) {
31
- return get_bookmark( $bookmark_id );
32
- }
33
-
34
- public function manage_value( $column_name, $id ) {
35
- echo $this->get_display_value_by_column_name( $column_name, $id );
36
- }
37
-
38
- protected function register_column_types() {
39
- $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/Link', 'AC_' );
40
- }
41
-
42
- }
classes/ListScreen/Media.php CHANGED
@@ -14,22 +14,33 @@ class AC_ListScreen_Media extends AC_ListScreenPost {
14
$this->set_key( 'wp-media' );
15
$this->set_group( 'media' );
16
$this->set_label( __( 'Media' ) );
17
-
18
- /* @see WP_Media_List_Table */
19
- $this->set_list_table_class( 'WP_Media_List_Table' );
20
}
21
22
public function set_manage_value_callback() {
23
add_action( 'manage_media_custom_column', array( $this, 'manage_value' ), 100, 2 );
24
}
25
26
- protected function get_object_by_id( $post_id ) {
27
// Author column depends on this global to be set.
28
global $authordata;
29
30
- $authordata = get_userdata( get_post_field( 'post_author', $post_id ) );
31
32
- return parent::get_object_by_id( $post_id );
33
}
34
35
/**
@@ -40,11 +51,9 @@ class AC_ListScreen_Media extends AC_ListScreenPost {
40
}
41
42
protected function register_column_types() {
43
- $this->register_column_type( new AC_Column_CustomField );
44
- $this->register_column_type( new AC_Column_Menu );
45
- $this->register_column_type( new AC_Column_Actions );
46
47
- $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/Media', 'AC_' );
48
}
49
50
}
14
$this->set_key( 'wp-media' );
15
$this->set_group( 'media' );
16
$this->set_label( __( 'Media' ) );
17
}
18
19
public function set_manage_value_callback() {
20
add_action( 'manage_media_custom_column', array( $this, 'manage_value' ), 100, 2 );
21
}
22
23
+ /**
24
+ * @return WP_Media_List_Table
25
+ */
26
+ public function get_list_table() {
27
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php' );
28
+
29
+ return new WP_Media_List_Table( array( 'screen' => $this->get_screen_id() ) );
30
+ }
31
+
32
+ /**
33
+ * @param int $id
34
+ *
35
+ * @return string
36
+ */
37
+ public function get_single_row( $id ) {
38
// Author column depends on this global to be set.
39
global $authordata;
40
41
+ $authordata = get_userdata( get_post_field( 'post_author', $id ) );
42
43
+ return parent::get_single_row( $id );
44
}
45
46
/**
51
}
52
53
protected function register_column_types() {
54
+ parent::register_column_types();
55
56
+ $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/Media', AC()->get_prefix() );
57
}
58
59
}
classes/ListScreen/Post.php CHANGED
@@ -13,16 +13,24 @@ class AC_ListScreen_Post extends AC_ListScreenPost {
13
$this->set_group( 'post' );
14
$this->set_key( $post_type );
15
$this->set_screen_id( $this->get_screen_base() . '-' . $post_type );
16
-
17
- /* @see WP_Posts_List_Table */
18
- $this->set_list_table_class( 'WP_Posts_List_Table' );
19
}
20
21
public function set_manage_value_callback() {
22
- /* @see WP_Posts_List_Table::column_default */
23
add_action( "manage_" . $this->get_post_type() . "_posts_custom_column", array( $this, 'manage_value' ), 100, 2 );
24
}
25
26
/**
27
* @since 2.0
28
*/
@@ -52,11 +60,9 @@ class AC_ListScreen_Post extends AC_ListScreenPost {
52
}
53
54
protected function register_column_types() {
55
- $this->register_column_type( new AC_Column_CustomField );
56
- $this->register_column_type( new AC_Column_Menu );
57
- $this->register_column_type( new AC_Column_Actions );
58
59
- $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/Post', 'AC_' );
60
}
61
62
}
13
$this->set_group( 'post' );
14
$this->set_key( $post_type );
15
$this->set_screen_id( $this->get_screen_base() . '-' . $post_type );
16
}
17
18
+ /**
19
+ * @see WP_Posts_List_Table::column_default
20
+ */
21
public function set_manage_value_callback() {
22
add_action( "manage_" . $this->get_post_type() . "_posts_custom_column", array( $this, 'manage_value' ), 100, 2 );
23
}
24
25
+ /**
26
+ * @return WP_Posts_List_Table
27
+ */
28
+ protected function get_list_table() {
29
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php' );
30
+
31
+ return new WP_Posts_List_Table( array( 'screen' => $this->get_screen_id() ) );
32
+ }
33
+
34
/**
35
* @since 2.0
36
*/
60
}
61
62
protected function register_column_types() {
63
+ parent::register_column_types();
64
65
+ $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/Post', AC()->get_prefix() );
66
}
67
68
}
classes/ListScreen/User.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
exit;
5
}
6
7
- class AC_ListScreen_User extends AC_ListScreen {
8
9
public function __construct() {
10
@@ -15,9 +15,6 @@ class AC_ListScreen_User extends AC_ListScreen {
15
$this->set_screen_id( 'users' );
16
$this->set_key( 'wp-users' );
17
$this->set_group( 'user' );
18
-
19
- /* @see WP_Users_List_Table */
20
- $this->set_list_table_class( 'WP_Users_List_Table' );
21
}
22
23
/**
@@ -27,6 +24,15 @@ class AC_ListScreen_User extends AC_ListScreen {
27
add_filter( 'manage_users_custom_column', array( $this, 'manage_value' ), 100, 3 );
28
}
29
30
/**
31
* @since 2.4.10
32
*/
@@ -39,22 +45,30 @@ class AC_ListScreen_User extends AC_ListScreen {
39
*
40
* @param string $value
41
* @param string $column_name
42
- * @param int $user_id
43
*/
44
public function manage_value( $value, $column_name, $user_id ) {
45
return $this->get_display_value_by_column_name( $column_name, $user_id, $value );
46
}
47
48
/**
49
* @since 3.0
50
* @return string HTML
51
*/
52
- public function get_single_row( $user_id ) {
53
-
54
- /* @var WP_Users_List_Table $table */
55
- $table = $this->get_list_table();
56
-
57
- return $table->single_row( get_userdata( $user_id ) );
58
}
59
60
protected function register_column_types() {
@@ -62,7 +76,14 @@ class AC_ListScreen_User extends AC_ListScreen {
62
$this->register_column_type( new AC_Column_Menu );
63
$this->register_column_type( new AC_Column_Actions );
64
65
- $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/User', 'AC_' );
66
}
67
68
}
4
exit;
5
}
6
7
+ class AC_ListScreen_User extends AC_ListScreenWP {
8
9
public function __construct() {
10
15
$this->set_screen_id( 'users' );
16
$this->set_key( 'wp-users' );
17
$this->set_group( 'user' );
18
}
19
20
/**
24
add_filter( 'manage_users_custom_column', array( $this, 'manage_value' ), 100, 3 );
25
}
26
27
+ /**
28
+ * @return WP_Users_List_Table
29
+ */
30
+ public function get_list_table() {
31
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php' );
32
+
33
+ return new WP_Users_List_Table( array( 'screen' => $this->get_screen_id() ) );
34
+ }
35
+
36
/**
37
* @since 2.4.10
38
*/
45
*
46
* @param string $value
47
* @param string $column_name
48
+ * @param int $user_id
49
*/
50
public function manage_value( $value, $column_name, $user_id ) {
51
return $this->get_display_value_by_column_name( $column_name, $user_id, $value );
52
}
53
54
+ /**
55
+ * @param int $id
56
+ *
57
+ * @return WP_User
58
+ */
59
+ protected function get_object( $id ) {
60
+ return get_userdata( $id );
61
+ }
62
+
63
/**
64
* @since 3.0
65
+ *
66
+ * @param int $id
67
+ *
68
* @return string HTML
69
*/
70
+ public function get_single_row( $id ) {
71
+ return $this->get_list_table()->single_row( $this->get_object( $id ) );
72
}
73
74
protected function register_column_types() {
76
$this->register_column_type( new AC_Column_Menu );
77
$this->register_column_type( new AC_Column_Actions );
78
79
+ $this->register_column_types_from_dir( AC()->get_plugin_dir() . 'classes/Column/User', AC()->get_prefix() );
80
+ }
81
+
82
+ /**
83
+ * @return string
84
+ */
85
+ public function get_default_orderby() {
86
+ return 'username';
87
}
88
89
}
classes/ListScreenPost.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
exit;
5
}
6
7
- abstract class AC_ListScreenPost extends AC_ListScreen {
8
9
/**
10
* @var string Post type
@@ -34,12 +34,12 @@ abstract class AC_ListScreenPost extends AC_ListScreen {
34
}
35
36
/**
37
- * @since 3.0
38
- * @param int $post_id Post ID
39
* @return WP_Post
40
*/
41
- protected function get_object_by_id( $post_id ) {
42
- return get_post( $post_id );
43
}
44
45
/**
@@ -53,4 +53,49 @@ abstract class AC_ListScreenPost extends AC_ListScreen {
53
return $post_type_object && isset( $post_type_object->labels->{$var} ) ? $post_type_object->labels->{$var} : false;
54
}
55
56
}
4
exit;
5
}
6
7
+ abstract class AC_ListScreenPost extends AC_ListScreenWP {
8
9
/**
10
* @var string Post type
34
}
35
36
/**
37
+ * @param int $id
38
+ *
39
* @return WP_Post
40
*/
41
+ protected function get_object( $id ) {
42
+ return get_post( $id );
43
}
44
45
/**
53
return $post_type_object && isset( $post_type_object->labels->{$var} ) ? $post_type_object->labels->{$var} : false;
54
}
55
56
+ /**
57
+ * @return array
58
+ */
59
+ public function get_default_orderby() {
60
+ return array( 'date', true );
61
+ }
62
+
63
+ /**
64
+ * Register Taxonomy columns that are set by WordPress. These native columns are registered
65
+ * by setting 'show_admin_column' to 'true' as an argument in register_taxonomy();
66
+ * Only supports Post Types.
67
+ *
68
+ * @see register_taxonomy
69
+ */
70
+ private function register_column_native_taxonomies() {
71
+ $taxonomies = get_taxonomies(
72
+ array(
73
+ 'show_ui' => 1,
74
+ 'show_admin_column' => 1,
75
+ '_builtin' => 0,
76
+ ),
77
+ 'object'
78
+ );
79
+
80
+ foreach ( $taxonomies as $taxonomy ) {
81
+ if ( in_array( $this->get_post_type(), $taxonomy->object_type ) ) {
82
+ $column = new ACP_Column_NativeTaxonomy();
83
+ $column->set_type( 'taxonomy-' . $taxonomy->name );
84
+
85
+ $this->register_column_type( $column );
86
+ }
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Register post specific columns
92
+ */
93
+ protected function register_column_types() {
94
+ $this->register_column_type( new AC_Column_CustomField );
95
+ $this->register_column_type( new AC_Column_Menu );
96
+ $this->register_column_type( new AC_Column_Actions );
97
+
98
+ //$this->register_column_native_taxonomies();
99
+ }
100
+
101
}
classes/ListScreenWP.php ADDED
@@ -0,0 +1,99 @@
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * @since 3.1
9
+ */
10
+ abstract class AC_ListScreenWP extends AC_ListScreen {
11
+
12
+ /**
13
+ * Class name of the WP_List_Table instance
14
+ *
15
+ * @see WP_List_Table
16
+ *
17
+ * @since 3.0
18
+ * @deprecated 3.1
19
+ *
20
+ * @var string
21
+ */
22
+ private $list_table_class;
23
+
24
+ /**
25
+ * @return WP_List_Table
26
+ */
27
+ abstract protected function get_list_table();
28
+
29
+ /**
30
+ * @param int $id
31
+ *
32
+ * @return object
33
+ */
34
+ abstract protected function get_object( $id );
35
+
36
+ /**
37
+ * @deprecated 3.1
38
+ * @return string
39
+ */
40
+ public function get_list_table_class() {
41
+ return $this->list_table_class;
42
+ }
43
+
44
+ /**
45
+ * @deprecated 3.1
46
+ *
47
+ * @param string $list_table_class
48
+ */
49
+ public function set_list_table_class( $list_table_class ) {
50
+ _deprecated_function( __METHOD__, '3.1', 'AC_ListScreenWP::get_list_table()' );
51
+
52
+ $this->list_table_class = (string) $list_table_class;
53
+ }
54
+
55
+ /**
56
+ * @param int $id
57
+ *
58
+ * @return string HTML
59
+ */
60
+ public function get_single_row( $id ) {
61
+ ob_start();
62
+ $this->get_list_table()->single_row( $this->get_object( $id ) );
63
+
64
+ return ob_get_clean();
65
+ }
66
+
67
+ /**
68
+ * @return array [ $column_name => [ $orderby, $order ], ... ]
69
+ */
70
+ public function get_default_sortable_columns() {
71
+ $sortables = array();
72
+
73
+ foreach ( $this->get_list_table()->get_sortable_columns() as $name => $data ) {
74
+ $data = (array) $data;
75
+
76
+ if ( ! isset( $data[1] ) ) {
77
+ $data[1] = false;
78
+ }
79
+
80
+ $sortables[ $name ] = $data;
81
+ }
82
+
83
+ return $sortables;
84
+ }
85
+
86
+ /**
87
+ * Get default column headers
88
+ *
89
+ * @see WP_List_Table::get_columns()
90
+ *
91
+ * @return array
92
+ */
93
+ public function get_default_column_headers() {
94
+ $this->get_list_table();
95
+
96
+ return (array) get_column_headers( $this->get_screen_id() );
97
+ }
98
+
99
+ }
classes/Meta/Query.php CHANGED
@@ -56,6 +56,11 @@ class AC_Meta_Query {
56
*/
57
private $order_by = array();
58
59
/**
60
* @param string $meta_type
61
*/
@@ -147,6 +152,10 @@ class AC_Meta_Query {
147
return $this;
148
}
149
150
public function distinct() {
151
$this->distinct = true;
152
@@ -156,10 +165,10 @@ class AC_Meta_Query {
156
/**
157
* Set a where clause
158
*
159
- * @param string|array $field
160
- * @param string $operator
161
* @param string|int|array $value
162
- * @param string $type
163
*
164
* @return array
165
*/
@@ -384,8 +393,14 @@ class AC_Meta_Query {
384
$order_by = ' ORDER BY ' . implode( ', ', $order_by_clauses );
385
}
386
387
// build query and store it
388
- $sql = $select . $from . $join . $where . $group_by . $order_by;
389
390
$this->set_sql( $sql );
391
@@ -416,7 +431,7 @@ class AC_Meta_Query {
416
*/
417
public function get_sql() {
418
$sql = preg_replace( '/ +/', ' ', $this->sql );
419
- $sql = preg_replace( '/(SELECT|FROM|LEFT|INNER|WHERE|(AND|OR) \(|(AND|OR) (?!\()|ORDER BY|GROUP BY)/', "\n$1", $sql );
420
421
return $sql . "\n";
422
}
56
*/
57
private $order_by = array();
58
59
+ /**
60
+ * @var int|false
61
+ */
62
+ private $limit = false;
63
+
64
/**
65
* @param string $meta_type
66
*/
152
return $this;
153
}
154
155
+ public function limit( $limit ) {
156
+ $this->limit = absint( $limit );
157
+ }
158
+
159
public function distinct() {
160
$this->distinct = true;
161
165
/**
166
* Set a where clause
167
*
168
+ * @param string|array $field
169
+ * @param string $operator
170
* @param string|int|array $value
171
+ * @param string $type
172
*
173
* @return array
174
*/
393
$order_by = ' ORDER BY ' . implode( ', ', $order_by_clauses );
394
}
395
396
+ $limit = '';
397
+
398
+ if ( $this->limit ) {
399
+ $limit = ' LIMIT ' . $this->limit;
400
+ }
401
+
402
// build query and store it
403
+ $sql = $select . $from . $join . $where . $group_by . $order_by . $limit;
404
405
$this->set_sql( $sql );
406
431
*/
432
public function get_sql() {
433
$sql = preg_replace( '/ +/', ' ', $this->sql );
434
+ $sql = preg_replace( '/(SELECT|FROM|LEFT|INNER|WHERE|(AND|OR) \(|(AND|OR) (?!\()|ORDER BY|GROUP BY|LIMIT)/', "\n$1", $sql );
435
436
return $sql . "\n";
437
}
classes/Plugin.php CHANGED
@@ -44,6 +44,38 @@ abstract class AC_Plugin extends AC_Addon {
44
return $data[ $key ];
45
}
46
47
/**
48
* @return string
49
*/
@@ -66,14 +98,18 @@ abstract class AC_Plugin extends AC_Addon {
66
/**
67
* Update the stored version to match the (current) version
68
*/
69
- public function update_stored_version( $version ) {
70
return update_option( $this->get_version_key(), $version );
71
}
72
73
/**
74
- * Check if the plugin was updated or is a fresh install
75
*/
76
- public function is_fresh_install() {
77
global $wpdb;
78
79
$sql = "
44
return $data[ $key ];
45
}
46
47
+ /**
48
+ * Return the prefix that is used by this plugin
49
+ *
50
+ * @return string
51
+ */
52
+ abstract public function get_prefix();
53
+
54
+ /**
55
+ * Apply updates to the database
56
+ *
57
+ * @param null|string $updates_dir
58
+ */
59
+ public function install() {
60
+ if ( 0 === version_compare( $this->get_version(), $this->get_stored_version() ) ) {
61
+ return;
62
+ }
63
+
64
+ $updater = new AC_Plugin_Updater( $this );
65
+
66
+ if ( ! $updater->check_update_conditions() ) {
67
+ return;
68
+ }
69
+
70
+ $classes = AC()->autoloader()->get_class_names_from_dir( $this->get_plugin_dir() . 'classes/Plugin/Update', $this->get_prefix() );
71
+
72
+ foreach ( $classes as $class ) {
73
+ $updater->add_update( new $class( $this->get_stored_version() ) );
74
+ }
75
+
76
+ $updater->parse_updates();
77
+ }
78
+
79
/**
80
* @return string
81
*/
98
/**
99
* Update the stored version to match the (current) version
100
*/
101
+ public function update_stored_version( $version = null ) {
102
+ if ( null === $version ) {
103
+ $version = $this->get_version();
104
+ }
105
+
106
return update_option( $this->get_version_key(), $version );
107
}
108
109
/**
110
+ * Check if the plugin was updated or is a new install
111
*/
112
+ public function is_new_install() {
113
global $wpdb;
114
115
$sql = "
classes/Plugin/Updater.php CHANGED
@@ -45,16 +45,30 @@ class AC_Plugin_Updater {
45
$this->updates[ $update->get_version() ] = $update;
46
}
47
48
- public function parse_updates() {
49
- // Network wide updating is not allowed
50
if ( is_network_admin() ) {
51
- return;
52
}
53
54
- $plugin = $this->plugin;
55
56
- if ( $plugin->is_fresh_install() ) {
57
- $plugin->update_stored_version( $plugin->get_version() );
58
59
return;
60
}
@@ -71,15 +85,17 @@ class AC_Plugin_Updater {
71
}
72
73
$update->apply_update();
74
- $plugin->update_stored_version( $update->get_version() );
75
}
76
}
77
78
- if ( $this->apply_updates ) {
79
- $plugin->update_stored_version( $plugin->get_version() );
80
- // TODO: https://github.com/codepress/admin-columns-issues/issues/982
81
- //$this->show_completed_notice();
82
}
83
}
84
85
protected function show_completed_notice() {
45
$this->updates[ $update->get_version() ] = $update;
46
}
47
48
+ /**
49
+ * Checks conditions like user permissions
50
+ *
51
+ */
52
+ public function check_update_conditions() {
53
+ if ( ! AC()->user_can_manage_admin_columns() ) {
54
+ return false;
55
+ }
56
+
57
+ // Network wide updating is not supported yet
58
if ( is_network_admin() ) {
59
+ return false;
60
}
61
62
+ return true;
63
+ }
64
+
65
+ public function parse_updates() {
66
+ if ( ! $this->check_update_conditions() ) {
67
+ return;
68
+ }
69
70
+ if ( $this->plugin->is_new_install() ) {
71
+ $this->plugin->update_stored_version();
72
73
return;
74
}
85
}
86
87
$update->apply_update();
88
+ $this->plugin->update_stored_version( $update->get_version() );
89
}
90
}
91
92
+ if ( ! $this->apply_updates ) {
93
+ return;
94
}
95
+
96
+ $this->plugin->update_stored_version();
97
+ // TODO: https://github.com/codepress/admin-columns-issues/issues/982
98
+ //$this->show_completed_notice();
99
}
100
101
protected function show_completed_notice() {
classes/Settings/Column.php CHANGED
@@ -262,7 +262,7 @@ abstract class AC_Settings_Column {
262
* @param string $type
263
* @param string|null $name
264
*
265
- * @return AC_Settings_Form_Element_Select|AC_Settings_Form_Element_Input|AC_Settings_Form_Element_Radio
266
*/
267
protected function create_element( $type, $name = null ) {
268
if ( null === $name ) {
@@ -272,11 +272,11 @@ abstract class AC_Settings_Column {
272
switch ( $type ) {
273
274
case 'checkbox' :
275
- $element = new AC_Settings_Form_Element_Checkbox( $name );
276
277
break;
278
case 'radio' :
279
- $element = new AC_Settings_Form_Element_Radio( $name );
280
281
break;
282
case 'select' :
@@ -284,7 +284,7 @@ abstract class AC_Settings_Column {
284
285
break;
286
default:
287
- $element = new AC_Settings_Form_Element_Input( $name );
288
$element->set_type( $type );
289
}
290
@@ -371,4 +371,5 @@ abstract class AC_Settings_Column {
371
public function get_column() {
372
return $this->column;
373
}
374
}
262
* @param string $type
263
* @param string|null $name
264
*
265
+ * @return AC_Form_Element_Select|AC_Form_Element_Input|AC_Form_Element_Radio
266
*/
267
protected function create_element( $type, $name = null ) {
268
if ( null === $name ) {
272
switch ( $type ) {
273
274
case 'checkbox' :
275
+ $element = new AC_Form_Element_Checkbox( $name );
276
277
break;
278
case 'radio' :
279
+ $element = new AC_Form_Element_Radio( $name );
280
281
break;
282
case 'select' :
284
285
break;
286
default:
287
+ $element = new AC_Form_Element_Input( $name );
288
$element->set_type( $type );
289
}
290
371
public function get_column() {
372
return $this->column;
373
}
374
+
375
}
classes/Settings/Column/AttachmentDisplay.php CHANGED
@@ -19,8 +19,10 @@ class AC_Settings_Column_AttachmentDisplay extends AC_Settings_Column
19
$settings = array();
20
21
switch ( $this->get_attachment_display() ) {
22
- case 'thumbnail':
23
$settings[] = new AC_Settings_Column_Images( $this->column );
24
}
25
26
return $settings;
19
$settings = array();
20
21
switch ( $this->get_attachment_display() ) {
22
+ case 'thumbnail' :
23
$settings[] = new AC_Settings_Column_Images( $this->column );
24
+
25
+ break;
26
}
27
28
return $settings;
classes/Settings/Column/Comment.php ADDED
@@ -0,0 +1,140 @@
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * @since 3.0.8
9
+ */
10
+ class AC_Settings_Column_Comment extends AC_Settings_Column
11
+ implements AC_Settings_FormatValueInterface {
12
+
13
+ /**
14
+ * @var string
15
+ */
16
+ private $comment_property;
17
+
18
+ protected function set_name() {
19
+ $this->name = 'comment';
20
+ }
21
+
22
+ protected function define_options() {
23
+ return array(
24
+ 'comment_property_display' => 'comment',
25
+ );
26
+ }
27
+
28
+ public function get_dependent_settings() {
29
+
30
+ switch ( $this->get_comment_property_display() ) {
31
+
32
+ case 'date' :
33
+ return array( new AC_Settings_Column_Date( $this->column ) );
34
+
35
+ break;
36
+ case 'comment' :
37
+ return array( new AC_Settings_Column_StringLimit( $this->column ) );
38
+
39
+ break;
40
+
41
+ default :
42
+ return array();
43
+ }
44
+ }
45
+
46
+ /**
47
+ * @param int $id
48
+ * @param mixed $original_value
49
+ *
50
+ * @return string|int
51
+ */
52
+ public function format( $id, $original_value ) {
53
+
54
+ switch ( $this->get_comment_property_display() ) {
55
+
56
+ case 'date' :
57
+ $value = $this->get_comment_property( 'comment_date', $id );
58
+
59
+ break;
60
+ case 'author' :
61
+ $value = $this->get_comment_property( 'comment_author', $id );
62
+
63
+ break;
64
+ case 'author_email' :
65
+ $value = $this->get_comment_property( 'comment_author_email', $id );
66
+
67
+ break;
68
+ case 'comment' :
69
+ $value = $this->get_comment_property( 'comment_content', $id );
70
+
71
+ break;
72
+ default :
73
+ $value = $id;
74
+ }
75
+
76
+ return $value;
77
+ }
78
+
79
+ /**
80
+ * @param string $property
81
+ * @param int $id
82
+ *
83
+ * @return false|string
84
+ */
85
+ private function get_comment_property( $property, $id ) {
86
+ $comment = get_comment( $id );
87
+
88
+ if ( ! isset( $comment->{$property} ) ) {
89
+ return false;
90
+ }
91
+
92
+ return $comment->{$property};
93
+ }
94
+
95
+ public function create_view() {
96
+ $select = $this->create_element( 'select' )
97
+ ->set_attribute( 'data-refresh', 'column' )
98
+ ->set_options( $this->get_display_options() );
99
+
100
+ $view = new AC_View( array(
101
+ 'label' => __( 'Display', 'codepress-admin-columns' ),
102
+ 'setting' => $select,
103
+ ) );
104
+
105
+ return $view;
106
+ }
107
+
108
+ protected function get_display_options() {
109
+ $options = array(
110
+ 'comment' => __( 'Comment' ),
111
+ 'id' => __( 'ID' ),
112
+ 'author' => __( 'Author' ),
113
+ 'author_email' => __( 'Author Email', 'codepress-admin-column' ),
114
+ 'date' => __( 'Date' ),
115
+ );
116
+
117
+ natcasesort( $options );
118
+
119
+ return $options;
120
+ }
121
+
122
+ /**
123
+ * @return string
124
+ */
125
+ public function get_comment_property_display() {
126
+ return $this->comment_property;
127
+ }
128
+
129
+ /**
130
+ * @param string $comment_property
131
+ *
132
+ * @return bool
133
+ */
134
+ public function set_comment_property_display( $comment_property ) {
135
+ $this->comment_property = $comment_property;
136
+
137
+ return true;
138
+ }
139
+
140
+ }
classes/Settings/Column/Date.php CHANGED
@@ -4,85 +4,25 @@ if ( ! defined( 'ABSPATH' ) ) {
4
exit;
5
}
6
7
- class AC_Settings_Column_Date extends AC_Settings_Column
8
- implements AC_Settings_FormatValueInterface {
9
10
- private $date_format;
11
12
- protected function set_name() {
13
- $this->name = 'date';
14
}
15
16
- protected function define_options() {
17
- return array(
18
- 'date_format' => 'wp_default',
19
- );
20
- }
21
-
22
- public function create_view() {
23
-
24
- $setting = $this
25
- ->create_element( 'text' )
26
- ->set_attribute( 'placeholder', $this->get_default() );
27
-
28
- $view = new AC_View( array(
29
- 'setting' => $setting,
30
- 'date_format' => $this->get_date_format(),
31
- 'date_options' => $this->get_date_options(),
32
- 'label' => __( 'Date Format', 'codepress-admin-columns' ),
33
- 'tooltip' => __( 'This will determine how the date will be displayed.', 'codepress-admin-columns' ),
34
- ) );
35
-
36
- $view->set_template( 'settings/setting-date' );
37
-
38
- return $view;
39
- }
40
-
41
- protected function get_html_label( $args ) {
42
- $defaults = array(
43
- 'label' => false,
44
- 'date_format' => false,
45
- 'description' => false,
46
- );
47
-
48
- $data = (object) wp_parse_args( $args, $defaults );
49
-
50
- $label = '';
51
-
52
- if ( $data->label ) {
53
- $label .= '<span class="ac-setting-input-date__value">' . $data->label . '</span>';
54
- }
55
- if ( $data->date_format ) {
56
- $label .= '<code>' . $data->date_format . '</code>';
57
- }
58
- if ( $data->description ) {
59
- $label .= '<span class="ac-setting-input-date__more hidden">' . $data->description . '</span>';
60
- }
61
-
62
- return $label;
63
- }
64
-
65
- protected function get_date_options() {
66
-
67
$options = array(
68
- 'diff' => $this->get_html_label( array(
69
- 'label' => __( 'Time Difference', 'codepress-admin-columns' ),
70
- 'description' => __( 'The difference is returned in a human readable format.', 'codepress-admin-columns' ) . ' <br/>' . sprintf( __( 'For example: %s.', 'codepress-admin-columns' ), '"' . $this->format_human_time_diff( strtotime( "-1 hour" ) ) . '" ' . __( 'or' ) . ' "' . $this->format_human_time_diff( strtotime( "-2 days" ) ) . '"' ),
71
- )
72
- ),
73
- );
74
-
75
- $default_args = array(
76
- 'label' => __( 'WordPress Date Format', 'codepress-admin-columns' ),
77
- 'date_format' => $this->get_wp_date_format(),
78
);
79
80
- if ( current_user_can( 'manage_options' ) ) {
81
- $default_args['description'] = sprintf( __( 'The %s can be changed in %s.', 'codepress-admin-columns' ), $default_args['label'], ac_helper()->html->link( admin_url( 'options-general.php' ) . '#date_format_custom_radio', strtolower( __( 'General Settings' ) ) ) );
82
- }
83
-
84
- $options['wp_default'] = $this->get_html_label( $default_args );
85
-
86
$formats = array(
87
'j F Y',
88
'Y-m-d',
@@ -91,78 +31,33 @@ class AC_Settings_Column_Date extends AC_Settings_Column
91
);
92
93
foreach ( $formats as $format ) {
94
- $options[ $format ] = $this->get_html_label( array( 'label' => date_i18n( $format ), 'date_format' => $format ) );
95
}
96
97
- $custom_label = $this->get_html_label( array(
98
- 'label' => __( 'Custom:', 'codepress-admin-columns' ),
99
- 'description' => sprintf( __( 'Learn more about %s.', 'codepress-admin-columns' ), ac_helper()->html->link( 'http://codex.wordpress.org/Formatting_Date_and_Time', __( 'date and time formatting', 'codepress-admin-columns' ) ), array( 'target' => '_blank' ) ),
100
- )
101
- );
102
- $custom_label .= '<input type="text" class="ac-setting-input-date__custom" value="' . esc_attr( $this->get_date_format() ) . '" disabled>';
103
- $custom_label .= '<span class="ac-setting-input-date__example"></span>';
104
-
105
- $options['custom'] = $custom_label;
106
-
107
return $options;
108
}
109
110
- private function get_wp_date_format() {
111
return get_option( 'date_format' );
112
}
113
114
- /**
115
- * @return mixed
116
- */
117
- public function get_date_format() {
118
- return $this->date_format;
119
- }
120
-
121
- /**
122
- * @param mixed $date_format
123
- *
124
- * @return bool
125
- */
126
- public function set_date_format( $date_format ) {
127
- $this->date_format = trim( $date_format );
128
-
129
- return true;
130
- }
131
-
132
/**
133
* @param string $date
134
*
135
* @return string
136
*/
137
public function format( $date, $original_value ) {
138
- if ( ! $date || ! is_scalar( $date ) ) {
139
- return false;
140
- }
141
-
142
- $date_format = $this->get_date_format();
143
144
- if ( ! $date_format ) {
145
- $date_format = $this->get_default();
146
}
147
148
- $timestamp = strtotime( $date );
149
-
150
- switch ( $date_format ) {
151
-
152
- case 'wp_default' :
153
- $date = date_i18n( $this->get_wp_date_format(), $timestamp );
154
-
155
- break;
156
- case 'diff' :
157
- $date = $this->format_human_time_diff( $timestamp );
158
-
159
- break;
160
- default :
161
-
162
- $date = date_i18n( $this->get_date_format(), $timestamp );
163
}
164
165
- return $date;
166
}
167
168
/**
4
exit;
5
}
6
7
+ class AC_Settings_Column_Date extends AC_Settings_Column_DateTimeFormat {
8
9
+ private function get_diff_html_label() {
10
+ $description = __( 'The difference is returned in a human readable format.', 'codepress-admin-columns' ) . ' <br/>' .
11
+ sprintf( __( 'For example: %s.', 'codepress-admin-columns' ),
12
+ '"' . $this->format_human_time_diff( strtotime( "-1 hour" ) ) . '" '
13
+ . __( 'or', 'codepress-admin-columns' ) .
14
+ ' "' . $this->format_human_time_diff( strtotime( "-2 days" ) ) . '"'
15
+ );
16
17
+ return $this->get_html_label( __( 'Time Difference', 'codepress-admin-columns' ), '', $description );
18
}
19
20
+ protected function get_custom_format_options() {
21
$options = array(
22
+ 'diff' => $this->get_diff_html_label(),
23
+ 'wp_default' => $this->get_default_html_label( __( 'WordPress Date Format', 'codepress-admin-columns' ) ),
24
);
25
26
$formats = array(
27
'j F Y',
28
'Y-m-d',
31
);
32
33
foreach ( $formats as $format ) {
34
+ $options[ $format ] = $this->get_html_label_from_date_format( $format );
35
}
36
37
return $options;
38
}
39
40
+ protected function get_wp_default_format() {
41
return get_option( 'date_format' );
42
}
43
44
/**
45
* @param string $date
46
*
47
* @return string
48
*/
49
public function format( $date, $original_value ) {
50
+ $timestamp = $this->get_timestamp( $date );
51
52
+ if ( ! $timestamp ) {
53
+ return false;
54
}
55
56
+ if ( 'diff' === $this->get_date_format() ) {
57
+ return $this->format_human_time_diff( $timestamp );
58
}
59
60
+ return parent::format( $date, $original_value );
61
}
62
63
/**
classes/Settings/Column/DateTimeFormat.php ADDED
@@ -0,0 +1,192 @@