Admin Columns - Version 2.4.8

Version Description

  • [Updated] Hidden custom fields are now grouped as "Hidden" in the dropdown list
  • [Updated] Minor performance improvements
  • [Fixed] New Yoast plugin compatibility
Download this release

Release Info

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

Code changes from version 2.4.7 to 2.4.8

Files changed (51) hide show
  1. assets/css/column.css +1 -0
  2. assets/css/column.min.css +1 -1
  3. assets/js/admin-settings.js +4 -5
  4. assets/js/admin-settings.min.js +1 -1
  5. classes/addons.php +30 -18
  6. classes/column.php +65 -15
  7. classes/column/custom-field.php +47 -20
  8. classes/column/post/parent.php +3 -8
  9. classes/column/post/ping-status.php +1 -1
  10. classes/column/post/status.php +5 -0
  11. classes/settings.php +1 -1
  12. classes/storage_model.php +61 -53
  13. classes/storage_model/comment.php +20 -58
  14. classes/storage_model/link.php +12 -47
  15. classes/storage_model/media.php +22 -61
  16. classes/storage_model/post.php +28 -70
  17. classes/storage_model/user.php +17 -60
  18. classes/third_party/yoast_seo.php +19 -18
  19. classes/utility.php +21 -0
  20. codepress-admin-columns.php +3 -13
  21. languages/README.md +8 -0
  22. languages/codepress-admin-columns-ar.mo +0 -0
  23. languages/codepress-admin-columns-ar.po +0 -1267
  24. languages/codepress-admin-columns-da_DK.mo +0 -0
  25. languages/codepress-admin-columns-da_DK.po +0 -1257
  26. languages/codepress-admin-columns-es_ES.mo +0 -0
  27. languages/codepress-admin-columns-es_ES.po +0 -1255
  28. languages/codepress-admin-columns-fa_IR.mo +0 -0
  29. languages/codepress-admin-columns-fa_IR.po +0 -1255
  30. languages/codepress-admin-columns-fr_FR.mo +0 -0
  31. languages/codepress-admin-columns-fr_FR.po +0 -1261
  32. languages/codepress-admin-columns-hu_HU.mo +0 -0
  33. languages/codepress-admin-columns-hu_HU.po +0 -1256
  34. languages/codepress-admin-columns-it_IT.mo +0 -0
  35. languages/codepress-admin-columns-it_IT.po +0 -1258
  36. languages/codepress-admin-columns-ja.mo +0 -0
  37. languages/codepress-admin-columns-ja.po +0 -1275
  38. languages/codepress-admin-columns-nl_NL.mo +0 -0
  39. languages/codepress-admin-columns-nl_NL.po +0 -1256
  40. languages/codepress-admin-columns-pl_PL.mo +0 -0
  41. languages/codepress-admin-columns-pl_PL.po +0 -1338
  42. languages/codepress-admin-columns-pt_BR.mo +0 -0
  43. languages/codepress-admin-columns-pt_BR.po +0 -1257
  44. languages/codepress-admin-columns-ru_RU.mo +0 -0
  45. languages/codepress-admin-columns-ru_RU.po +0 -1258
  46. languages/codepress-admin-columns-sv_SE.mo +0 -0
  47. languages/codepress-admin-columns-sv_SE.po +0 -1256
  48. languages/codepress-admin-columns-zh_CN.mo +0 -0
  49. languages/codepress-admin-columns-zh_CN.po +0 -1262
  50. languages/codepress-admin-columns.pot +331 -331
  51. readme.txt +6 -1
assets/css/column.css CHANGED
@@ -90,6 +90,7 @@ div.sizes span.not-available {
90
text-indent: 9999px;
91
margin-right: 4px;
92
padding: 0 13px;
93
}
94
.button.cpac-button-action:before {
95
position: absolute;
90
text-indent: 9999px;
91
margin-right: 4px;
92
padding: 0 13px;
93
+ overflow: hidden;
94
}
95
.button.cpac-button-action:before {
96
position: absolute;
assets/css/column.min.css CHANGED
@@ -1 +1 @@
1
- .cpac-divider{display:inline-block;width:14px;height:12px;background:url(../images/square.png) 50% 7px no-repeat}span.status-closed{color:red}.tablenav.top .cpac-edit{top:0;display:inline-block;vertical-align:bottom}.cpac-rounded{display:inline-block;border-radius:10px;min-width:8px;padding:0 6px;height:20px;background-color:#e0e0e0;text-align:center;margin-left:8px;font-size:12px}.cpac-column-value-image{display:inline-block;background:0 0;margin-right:2px;overflow:hidden}.rtl .cpac-column-value-image{margin-left:2px;margin-right:0}.cpac-column-value-image img{display:block;margin:0 auto}.column-column-attachment img{padding-right:5px;padding-bottom:4px}.rtl .column-column-attachment img{padding-left:5px;padding-right:0}div.cpac-color{line-height:26px}div.cpac-color span{display:block;-webkit-border-radius:3px;border-radius:3px;color:#fff;float:left;height:16px;line-height:16px;margin-right:12px;overflow:hidden;padding:4px 5px;font-size:10px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;min-width:47px;text-align:center}.rtl div.cpac-color span{float:right;margin-left:12px;margin-right:0}div.sizes span.not-available{color:#999}.button.cpac-button-action{position:relative;text-indent:9999px;margin-right:4px;padding:0 13px}.button.cpac-button-action:before{position:absolute;top:0;left:0;width:100%;height:100%;text-indent:0}.cpac-tip{display:inline-block}.qtip.qtip-tipsy{background:rgba(0,0,0,.75);font-weight:400;min-width:25px}
1
+ .cpac-divider{display:inline-block;width:14px;height:12px;background:url(../images/square.png) 50% 7px no-repeat}span.status-closed{color:red}.tablenav.top .cpac-edit{top:0;display:inline-block;vertical-align:bottom}.cpac-rounded{display:inline-block;border-radius:10px;min-width:8px;padding:0 6px;height:20px;background-color:#e0e0e0;text-align:center;margin-left:8px;font-size:12px}.cpac-column-value-image{display:inline-block;background:0 0;margin-right:2px;overflow:hidden}.rtl .cpac-column-value-image{margin-left:2px;margin-right:0}.cpac-column-value-image img{display:block;margin:0 auto}.column-column-attachment img{padding-right:5px;padding-bottom:4px}.rtl .column-column-attachment img{padding-left:5px;padding-right:0}div.cpac-color{line-height:26px}div.cpac-color span{display:block;-webkit-border-radius:3px;border-radius:3px;color:#fff;float:left;height:16px;line-height:16px;margin-right:12px;overflow:hidden;padding:4px 5px;font-size:10px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;min-width:47px;text-align:center}.rtl div.cpac-color span{float:right;margin-left:12px;margin-right:0}div.sizes span.not-available{color:#999}.button.cpac-button-action{position:relative;text-indent:9999px;margin-right:4px;padding:0 13px;overflow:hidden}.button.cpac-button-action:before{position:absolute;top:0;left:0;width:100%;height:100%;text-indent:0}.cpac-tip{display:inline-block}.qtip.qtip-tipsy{background:rgba(0,0,0,.75);font-weight:400;min-width:25px}
assets/js/admin-settings.js CHANGED
@@ -291,11 +291,10 @@ jQuery.fn.column_bind_events = function() {
291
jQuery(this).parents( '.label' ).find('p.description').hide();
292
});
293
294
- if ( column.find( '.column_type select' ).val() == 'column-meta' ) {
295
- column.find( '.column_field_type select' ).change( function() {
296
- column.cpac_column_refresh();
297
- } );
298
- }
299
};
300
301
/*
291
jQuery(this).parents( '.label' ).find('p.description').hide();
292
});
293
294
+ // refresh column and re-bind all events
295
+ column.find( '[data-refresh="1"] select' ).change( function() {
296
+ column.cpac_column_refresh();
297
+ } );
298
};
299
300
/*
assets/js/admin-settings.min.js CHANGED
@@ -1 +1 @@
1
- function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_submit_form(){jQuery(".form-update a.submit-update").click(function(e){e.preventDefault(),jQuery(this).closest(".columns-container").find(".cpac-columns form").submit()})}function cpac_create_column(e){var n=jQuery(".for-cloning-only .cpac-column",e).first().clone(),t=e.attr("data-type");return n.length>0&&(n.cpac_update_clone_id(t),jQuery(".cpac-columns form",e).append(n),n.column_bind_toggle(),n.column_bind_remove(),n.column_bind_clone(),n.column_bind_events(),cpac_sortable(),jQuery(document).trigger("column_add",n)),n}function cpac_add_column(){jQuery("#cpac .add_column").click(function(e){var n=jQuery(this).closest(".columns-container"),t=cpac_create_column(n);t.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:t.offset().top-58},300)}),e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var n=e(".sidebox#direct-feedback");n.find("#feedback-choice a.no").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-support").slideDown()}),n.find("#feedback-choice a.yes").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-rate").slideDown()})})}function cpac_clear_input_defaults(){jQuery.fn.cleardefault=function(){return this.focus(function(){this.value==this.defaultValue&&(this.value="")}).blur(function(){this.value.length||(this.value=this.defaultValue)})},jQuery("#cpac-box-plugin_settings .addons input").cleardefault()}function cpac_help(){jQuery("#cpac a.help").click(function(e){e.preventDefault();var n=jQuery("#contextual-help-wrap");n.parent().show(),jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',n).trigger("click"),n.slideDown("fast",function(){n.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),n=e.attr("rel"),t=e.attr("data-pos"),i={at:"left top",my:"right top",edge:"right",offset:"0 0"};"right"==t&&(i={at:"right middle",my:"left middle",edge:"left"}),e.pointer({content:jQuery("#"+n).html(),position:i,pointerWidth:250,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+i.edge}),e.click(function(){e.hasClass("open")?e.removeClass("open"):e.addClass("open")}),e.hover(function(){jQuery(this).pointer("open")},function(){e.hasClass("open")||jQuery(this).pointer("close")})})}function cpac_sortable(){jQuery("div.cpac-columns").each(function(){jQuery(this).hasClass("ui-sortable")?jQuery(this).sortable("refresh"):jQuery(this).sortable({items:".cpac-column"})})}function cpac_menu(){var e=jQuery("#cpac div.cpac-menu");e.find("a").click(function(e,n){var t=jQuery(this).attr("href");if(t){var i=t.replace("#cpac-box-","");jQuery(".cpac-menu a").removeClass("current"),jQuery(".columns-container").hide(),jQuery(this).addClass("current");var c=jQuery('.columns-container[data-type="'+i+'"]').show(),a=c.find(".cpac-columns");jQuery(document).trigger("cac_menu_change",a)}e.preventDefault()}),e.find("a.current").trigger("click")}jQuery(document).ready(function(){return 0===jQuery("#cpac").length?!1:(cpac_pointer(),cpac_submit_form(),cpac_clear_input_defaults(),cpac_sortable(),cpac_menu(),cpac_help(),cpac_add_column(),cpac_importexport(),cpac_sidebar_feedback(),void jQuery(".cpac-column").each(function(e,n){jQuery(n).column_bind_toggle(),jQuery(n).column_bind_remove(),jQuery(n).column_bind_clone(),jQuery(n).cpac_bind_container_addon_events()}))}),jQuery.fn.column_bind_toggle=function(){var e=jQuery(this);e.find("td.column_type a, td.column_edit, td.column_label a.toggle, td.column_label .edit-button").click(function(n){n.preventDefault(),e.toggleClass("opened").find(".column-form").slideToggle(150),e.hasClass("events-binded")||e.column_bind_events(),e.addClass("events-binded"),jQuery(document).trigger("column_init",e)})},jQuery.fn.column_bind_remove=function(){jQuery(this).find(".remove-button").click(function(e){jQuery(this).closest(".cpac-column").column_remove(),e.preventDefault()})},jQuery.fn.column_bind_clone=function(){jQuery(this).find(".clone-button").click(function(e){var n,t;e.preventDefault(),n=jQuery(this).closest(".cpac-column"),t=n.column_clone(),"undefined"!=typeof t&&t.removeClass("loading").hide().slideDown()})},jQuery.fn.cpac_column_refresh=function(){var e=jQuery(this);e.addClass("loading"),e.find(".column-form").prepend('<span class="spinner" />'),jQuery.post(ajaxurl,{plugin_id:"cpac",action:"cpac_column_refresh",column:jQuery(this).find("input.column-name").val(),formdata:jQuery(this).parents("form").serialize()},function(n){var t=jQuery("<div>"+n+"</div>").children();e.replaceWith(t),e=t,e.column_bind_toggle(),e.column_bind_remove(),e.column_bind_clone(),e.column_bind_events(),e.removeClass("loading").addClass("opened").find(".column-form").show(),jQuery(document).trigger("column_change",e)})},jQuery.fn.column_bind_events=function(){var e=jQuery(this),n=e.closest(".columns-container "),t=n.attr("data-type"),i=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var c=jQuery("optgroup",this).children(":selected"),a=c.val(),o=c.text(),r=jQuery(this).next(".msg").hide(),u=n.find('.for-cloning-only .cpac-column[data-type="'+a+'"]');if(u.length)if(u.find(".is-disabled").length)r.html(u.find(".is-disabled").html()).show(),jQuery(this).find("option").removeAttr("selected"),jQuery(this).find('option[value="'+i+'"]').attr("selected","selected");else{if("undefined"==typeof u.attr("data-clone")&&jQuery(".cpac-columns",n).find('[data-type="'+a+'"]').length)return r.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show(),jQuery(this).find("option").removeAttr("selected"),void jQuery(this).find('option[value="'+i+'"]').attr("selected","selected");var l=u.clone();l.addClass("opened").find(".column-form").show(),l.find(".column-meta").replaceWith(e.find(".column-meta")),l.find(".column-form").replaceWith(e.find(".column-form")),l.cpac_update_clone_id(t),e.replaceWith(l),l.cpac_column_refresh()}}),e.find(".column_label .input input").bind("keyup change",function(){var e=jQuery(this).val();jQuery(this).closest(".cpac-column").find("td.column_label .inner > a.toggle").text(e)}),e.column_width_slider();var c=e.find(".column-meta span.width");c.on("update",function(){var n=e.find("input.width").val(),t=e.find("input.unit").filter(":checked").val();n>0?jQuery(this).text(n+t):jQuery(this).text("")});var a=e.find(".column_width .unit-select label");a.on("click",function(){e.find("span.unit").text(jQuery(this).find("input").val()),e.column_width_slider(),c.trigger("update")});var o=e.find("input.width").on("keyup",function(){e.column_width_slider(),jQuery(this).trigger("validate"),c.trigger("update")}).on("validate",function(){var e=o.val(),n=jQuery.trim(e);jQuery.isNumeric(n)||(n=n.replace(/\D/g,"")),n.length>3&&(n=n.substring(0,3)),0>=n&&(n=""),n!==e&&o.val(n)});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");jQuery(this).hasClass("image-size-custom")?(jQuery(".custom-size-w",e).removeClass("hidden"),jQuery(".custom-size-h",e).removeClass("hidden")):(jQuery(".custom-size-w",e).addClass("hidden"),jQuery(".custom-size-h",e).addClass("hidden"))}),e.find(".column-form .label label, .column-form .label .info").hover(function(){jQuery(this).parents(".label").find("p.description").show()},function(){jQuery(this).parents(".label").find("p.description").hide()}),"column-meta"==e.find(".column_type select").val()&&e.find(".column_field_type select").change(function(){e.cpac_column_refresh()})},jQuery.fn.column_remove=function(){jQuery(this).addClass("deleting").animate({opacity:0,height:0},350,function(e){jQuery(this).remove()})},jQuery.fn.column_width_slider=function(){var e=jQuery(this).find(".column_width"),n=e.find("input.width"),t=e.find("input.unit"),i=t.filter(":checked").val(),c=n.val(),a=e.find(".width-slider"),o=jQuery(this).find(".column-meta span.width");"%"==i&&c>100&&(c=100),n.val(c),a.slider({range:"min",min:0,max:"%"==i?100:500,value:c,slide:function(e,t){n.val(t.value),o.trigger("update"),n.trigger("validate")}})},jQuery.fn.column_clone=function(){var e=jQuery(this).closest(".columns-container"),n=jQuery(this);if("undefined"==typeof n.attr("data-clone")){var t=cpac_i18n.clone.replace("%s","<strong>"+n.find(".column_label .toggle").text()+"</strong>");return n.addClass("opened").find(".column-form").slideDown(150),void n.find(".msg").html(t).show()}var i=jQuery(this).clone();return i.cpac_update_clone_id(e.attr("data-type")),jQuery(this).after(i),i.column_bind_toggle(),i.column_bind_remove(),i.column_bind_clone(),i.column_bind_events(),cpac_sortable(),jQuery(document).trigger("column_add",i),i},jQuery.fn.cpac_update_clone_id=function(e){var n=jQuery(this),t=n.attr("data-type"),i=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),c=jQuery(i).find('*[data-type="'+t+'"]').not(n),a=jQuery.map(c,function(e,n){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});a.sort();for(var o=Math.max.apply(null,a)+1,r=0;o>=r&&-1!==jQuery.inArray(r,a);r++);if(0!==r){var u=n.attr("data-clone"),l="";u&&(l="-"+u),n.attr("data-clone",r),n.find("input.clone").val(r),n.find("input.column-name").val(t+"-"+r);var d=n.find("input, select, label");jQuery(d).each(function(e,n){var i=t+"-"+r;jQuery(n).attr("name")&&jQuery(n).attr("name",jQuery(n).attr("name").replace(t+l,i)),jQuery(n).attr("for")&&jQuery(n).attr("for",jQuery(n).attr("for").replace(t+l,i)),jQuery(n).attr("id")&&jQuery(n).attr("id",jQuery(n).attr("id").replace(t+l,i))})}},jQuery(document).bind("column_init column_change column_add",function(e,n){jQuery(n).cpac_bind_column_addon_events(),jQuery(n).cpac_bind_container_addon_events()}),jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),n=e.find("[data-toggle-id] label");n.on("click",function(){var n=jQuery(this).closest("td.input").data("toggle-id"),t=jQuery("input",this).val(),i=e.find('[data-indicator-id="'+n+'"]').removeClass("on");"on"==t&&i.addClass("on");var c=e.find('[data-additional-option-id="'+n+'"]').addClass("hide");"on"==t&&c.removeClass("hide")}),e.find("[data-toggle-id]").each(function(){var n=e.find('[data-additional-option-id="'+jQuery(this).data("toggle-id")+'"]').addClass("hide");"on"==jQuery("input:checked",this).val()&&n.removeClass("hide")})},jQuery.fn.cpac_bind_container_addon_events=function(){var e=jQuery(this),n=e.find("[data-indicator-id]");n.unbind("click").click(function(){var n=jQuery(this).data("indicator-id"),t=e.find('[data-toggle-id="'+n+'"] input');jQuery(this).hasClass("on")?(jQuery(this).removeClass("on").addClass("off"),t.filter("[value=off]").prop("checked",!0)):(jQuery(this).removeClass("off").addClass("on"),t.filter("[value=on]").prop("checked",!0))})};
1
+ function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_submit_form(){jQuery(".form-update a.submit-update").click(function(e){e.preventDefault(),jQuery(this).closest(".columns-container").find(".cpac-columns form").submit()})}function cpac_create_column(e){var n=jQuery(".for-cloning-only .cpac-column",e).first().clone(),t=e.attr("data-type");return n.length>0&&(n.cpac_update_clone_id(t),jQuery(".cpac-columns form",e).append(n),n.column_bind_toggle(),n.column_bind_remove(),n.column_bind_clone(),n.column_bind_events(),cpac_sortable(),jQuery(document).trigger("column_add",n)),n}function cpac_add_column(){jQuery("#cpac .add_column").click(function(e){var n=jQuery(this).closest(".columns-container"),t=cpac_create_column(n);t.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:t.offset().top-58},300)}),e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var n=e(".sidebox#direct-feedback");n.find("#feedback-choice a.no").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-support").slideDown()}),n.find("#feedback-choice a.yes").click(function(e){e.preventDefault(),n.find("#feedback-choice").slideUp(),n.find("#feedback-rate").slideDown()})})}function cpac_clear_input_defaults(){jQuery.fn.cleardefault=function(){return this.focus(function(){this.value==this.defaultValue&&(this.value="")}).blur(function(){this.value.length||(this.value=this.defaultValue)})},jQuery("#cpac-box-plugin_settings .addons input").cleardefault()}function cpac_help(){jQuery("#cpac a.help").click(function(e){e.preventDefault();var n=jQuery("#contextual-help-wrap");n.parent().show(),jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',n).trigger("click"),n.slideDown("fast",function(){n.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),n=e.attr("rel"),t=e.attr("data-pos"),i={at:"left top",my:"right top",edge:"right",offset:"0 0"};"right"==t&&(i={at:"right middle",my:"left middle",edge:"left"}),e.pointer({content:jQuery("#"+n).html(),position:i,pointerWidth:250,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+i.edge}),e.click(function(){e.hasClass("open")?e.removeClass("open"):e.addClass("open")}),e.hover(function(){jQuery(this).pointer("open")},function(){e.hasClass("open")||jQuery(this).pointer("close")})})}function cpac_sortable(){jQuery("div.cpac-columns").each(function(){jQuery(this).hasClass("ui-sortable")?jQuery(this).sortable("refresh"):jQuery(this).sortable({items:".cpac-column"})})}function cpac_menu(){var e=jQuery("#cpac div.cpac-menu");e.find("a").click(function(e,n){var t=jQuery(this).attr("href");if(t){var i=t.replace("#cpac-box-","");jQuery(".cpac-menu a").removeClass("current"),jQuery(".columns-container").hide(),jQuery(this).addClass("current");var c=jQuery('.columns-container[data-type="'+i+'"]').show(),a=c.find(".cpac-columns");jQuery(document).trigger("cac_menu_change",a)}e.preventDefault()}),e.find("a.current").trigger("click")}jQuery(document).ready(function(){return 0===jQuery("#cpac").length?!1:(cpac_pointer(),cpac_submit_form(),cpac_clear_input_defaults(),cpac_sortable(),cpac_menu(),cpac_help(),cpac_add_column(),cpac_importexport(),cpac_sidebar_feedback(),void jQuery(".cpac-column").each(function(e,n){jQuery(n).column_bind_toggle(),jQuery(n).column_bind_remove(),jQuery(n).column_bind_clone(),jQuery(n).cpac_bind_container_addon_events()}))}),jQuery.fn.column_bind_toggle=function(){var e=jQuery(this);e.find("td.column_type a, td.column_edit, td.column_label a.toggle, td.column_label .edit-button").click(function(n){n.preventDefault(),e.toggleClass("opened").find(".column-form").slideToggle(150),e.hasClass("events-binded")||e.column_bind_events(),e.addClass("events-binded"),jQuery(document).trigger("column_init",e)})},jQuery.fn.column_bind_remove=function(){jQuery(this).find(".remove-button").click(function(e){jQuery(this).closest(".cpac-column").column_remove(),e.preventDefault()})},jQuery.fn.column_bind_clone=function(){jQuery(this).find(".clone-button").click(function(e){var n,t;e.preventDefault(),n=jQuery(this).closest(".cpac-column"),t=n.column_clone(),"undefined"!=typeof t&&t.removeClass("loading").hide().slideDown()})},jQuery.fn.cpac_column_refresh=function(){var e=jQuery(this);e.addClass("loading"),e.find(".column-form").prepend('<span class="spinner" />'),jQuery.post(ajaxurl,{plugin_id:"cpac",action:"cpac_column_refresh",column:jQuery(this).find("input.column-name").val(),formdata:jQuery(this).parents("form").serialize()},function(n){var t=jQuery("<div>"+n+"</div>").children();e.replaceWith(t),e=t,e.column_bind_toggle(),e.column_bind_remove(),e.column_bind_clone(),e.column_bind_events(),e.removeClass("loading").addClass("opened").find(".column-form").show(),jQuery(document).trigger("column_change",e)})},jQuery.fn.column_bind_events=function(){var e=jQuery(this),n=e.closest(".columns-container "),t=n.attr("data-type"),i=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var c=jQuery("optgroup",this).children(":selected"),a=c.val(),o=c.text(),r=jQuery(this).next(".msg").hide(),u=n.find('.for-cloning-only .cpac-column[data-type="'+a+'"]');if(u.length)if(u.find(".is-disabled").length)r.html(u.find(".is-disabled").html()).show(),jQuery(this).find("option").removeAttr("selected"),jQuery(this).find('option[value="'+i+'"]').attr("selected","selected");else{if("undefined"==typeof u.attr("data-clone")&&jQuery(".cpac-columns",n).find('[data-type="'+a+'"]').length)return r.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show(),jQuery(this).find("option").removeAttr("selected"),void jQuery(this).find('option[value="'+i+'"]').attr("selected","selected");var l=u.clone();l.addClass("opened").find(".column-form").show(),l.find(".column-meta").replaceWith(e.find(".column-meta")),l.find(".column-form").replaceWith(e.find(".column-form")),l.cpac_update_clone_id(t),e.replaceWith(l),l.cpac_column_refresh()}}),e.find(".column_label .input input").bind("keyup change",function(){var e=jQuery(this).val();jQuery(this).closest(".cpac-column").find("td.column_label .inner > a.toggle").text(e)}),e.column_width_slider();var c=e.find(".column-meta span.width");c.on("update",function(){var n=e.find("input.width").val(),t=e.find("input.unit").filter(":checked").val();n>0?jQuery(this).text(n+t):jQuery(this).text("")});var a=e.find(".column_width .unit-select label");a.on("click",function(){e.find("span.unit").text(jQuery(this).find("input").val()),e.column_width_slider(),c.trigger("update")});var o=e.find("input.width").on("keyup",function(){e.column_width_slider(),jQuery(this).trigger("validate"),c.trigger("update")}).on("validate",function(){var e=o.val(),n=jQuery.trim(e);jQuery.isNumeric(n)||(n=n.replace(/\D/g,"")),n.length>3&&(n=n.substring(0,3)),0>=n&&(n=""),n!==e&&o.val(n)});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");jQuery(this).hasClass("image-size-custom")?(jQuery(".custom-size-w",e).removeClass("hidden"),jQuery(".custom-size-h",e).removeClass("hidden")):(jQuery(".custom-size-w",e).addClass("hidden"),jQuery(".custom-size-h",e).addClass("hidden"))}),e.find(".column-form .label label, .column-form .label .info").hover(function(){jQuery(this).parents(".label").find("p.description").show()},function(){jQuery(this).parents(".label").find("p.description").hide()}),e.find('[data-refresh="1"] select').change(function(){e.cpac_column_refresh()})},jQuery.fn.column_remove=function(){jQuery(this).addClass("deleting").animate({opacity:0,height:0},350,function(e){jQuery(this).remove()})},jQuery.fn.column_width_slider=function(){var e=jQuery(this).find(".column_width"),n=e.find("input.width"),t=e.find("input.unit"),i=t.filter(":checked").val(),c=n.val(),a=e.find(".width-slider"),o=jQuery(this).find(".column-meta span.width");"%"==i&&c>100&&(c=100),n.val(c),a.slider({range:"min",min:0,max:"%"==i?100:500,value:c,slide:function(e,t){n.val(t.value),o.trigger("update"),n.trigger("validate")}})},jQuery.fn.column_clone=function(){var e=jQuery(this).closest(".columns-container"),n=jQuery(this);if("undefined"==typeof n.attr("data-clone")){var t=cpac_i18n.clone.replace("%s","<strong>"+n.find(".column_label .toggle").text()+"</strong>");return n.addClass("opened").find(".column-form").slideDown(150),void n.find(".msg").html(t).show()}var i=jQuery(this).clone();return i.cpac_update_clone_id(e.attr("data-type")),jQuery(this).after(i),i.column_bind_toggle(),i.column_bind_remove(),i.column_bind_clone(),i.column_bind_events(),cpac_sortable(),jQuery(document).trigger("column_add",i),i},jQuery.fn.cpac_update_clone_id=function(e){var n=jQuery(this),t=n.attr("data-type"),i=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),c=jQuery(i).find('*[data-type="'+t+'"]').not(n),a=jQuery.map(c,function(e,n){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});a.sort();for(var o=Math.max.apply(null,a)+1,r=0;o>=r&&-1!==jQuery.inArray(r,a);r++);if(0!==r){var u=n.attr("data-clone"),l="";u&&(l="-"+u),n.attr("data-clone",r),n.find("input.clone").val(r),n.find("input.column-name").val(t+"-"+r);var d=n.find("input, select, label");jQuery(d).each(function(e,n){var i=t+"-"+r;jQuery(n).attr("name")&&jQuery(n).attr("name",jQuery(n).attr("name").replace(t+l,i)),jQuery(n).attr("for")&&jQuery(n).attr("for",jQuery(n).attr("for").replace(t+l,i)),jQuery(n).attr("id")&&jQuery(n).attr("id",jQuery(n).attr("id").replace(t+l,i))})}},jQuery(document).bind("column_init column_change column_add",function(e,n){jQuery(n).cpac_bind_column_addon_events(),jQuery(n).cpac_bind_container_addon_events()}),jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),n=e.find("[data-toggle-id] label");n.on("click",function(){var n=jQuery(this).closest("td.input").data("toggle-id"),t=jQuery("input",this).val(),i=e.find('[data-indicator-id="'+n+'"]').removeClass("on");"on"==t&&i.addClass("on");var c=e.find('[data-additional-option-id="'+n+'"]').addClass("hide");"on"==t&&c.removeClass("hide")}),e.find("[data-toggle-id]").each(function(){var n=e.find('[data-additional-option-id="'+jQuery(this).data("toggle-id")+'"]').addClass("hide");"on"==jQuery("input:checked",this).val()&&n.removeClass("hide")})},jQuery.fn.cpac_bind_container_addon_events=function(){var e=jQuery(this),n=e.find("[data-indicator-id]");n.unbind("click").click(function(){var n=jQuery(this).data("indicator-id"),t=e.find('[data-toggle-id="'+n+'"] input');jQuery(this).hasClass("on")?(jQuery(this).removeClass("on").addClass("off"),t.filter("[value=off]").prop("checked",!0)):(jQuery(this).removeClass("off").addClass("on"),t.filter("[value=on]").prop("checked",!0))})};
classes/addons.php CHANGED
@@ -1,4 +1,5 @@
1
<?php
2
class CPAC_Addons {
3
4
/**
@@ -33,30 +34,34 @@ class CPAC_Addons {
33
*/
34
public function handle_install_request() {
35
36
- if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'install-cac-addon' ) || ! isset( $_GET['plugin'] ) )
37
return;
38
39
if ( ! $this->get_addon( $_GET['plugin'] ) ) {
40
cpac_admin_message( 'Addon does not exist.', 'error' );
41
return;
42
}
43
44
if ( ! class_exists( 'CAC_Addon_Pro', false ) ) {
45
cpac_admin_message( 'You need Admin Columns Pro.', 'error' );
46
return;
47
}
48
49
// Hook: trigger possible warning message before running WP installer ( api errors etc. )
50
if ( $error = apply_filters( 'cac/addons/install_request/maybe_error', false, $_GET['plugin'] ) ) {
51
cpac_admin_message( $error, 'error' );
52
return;
53
}
54
55
$install_url = add_query_arg( array(
56
- 'action' => 'install-plugin',
57
- 'plugin' => $_GET['plugin'],
58
'cpac-redirect' => true
59
- ), wp_nonce_url( network_admin_url( 'update.php'), 'install-plugin_' . $_GET['plugin'] ) );
60
61
wp_redirect( $install_url );
62
exit;
@@ -126,22 +131,23 @@ class CPAC_Addons {
126
* @since 2.2
127
*
128
* @param bool $grouped Whether to group the plugins by addon group ()
129
* @return array Available addons ([addon_basename] => (array) [addon_details] if not grouped, a list of these key-value pairs per group otherwise ([group_name] => (array) [group_addons]))
130
*/
131
public function get_available_addons( $grouped = false ) {
132
133
$addons = array(
134
- 'cac-addon-acf' => array(
135
- 'title' => __( 'Advanced Custom Fields', 'codepress-admin-columns' ),
136
- 'description' => __( 'Display and edit Advanced Custom Fields fields in the posts overview in seconds!', 'codepress-admin-columns' ),
137
- 'group' => 'integration',
138
- 'image' => CPAC_URL . 'assets/images/addons/acf.png'
139
),
140
'cac-addon-woocommerce' => array(
141
- 'title' => __( 'WooCommerce', 'codepress-admin-columns' ),
142
- 'description' => __( 'Enhance the products, orders and coupons overviews with new columns and inline editing.', 'codepress-admin-columns' ),
143
- 'group' => 'integration',
144
- 'image' => CPAC_URL . 'assets/images/addons/woocommerce.png'
145
)
146
);
147
@@ -156,9 +162,9 @@ class CPAC_Addons {
156
157
foreach ( $addons as $addon_name => $addon ) {
158
$addons[ $addon_name ] = wp_parse_args( $addon, array(
159
- 'title' => '',
160
- 'group' => '',
161
- 'image' => ''
162
) );
163
}
164
@@ -176,6 +182,7 @@ class CPAC_Addons {
176
* @since 2.2
177
*
178
* @param string $id Unique addon ID
179
* @return bool|array Returns addon details if the add-on exists, false otherwise
180
*/
181
public function get_addon( $id ) {
@@ -196,11 +203,12 @@ class CPAC_Addons {
196
* @uses CPAC_Addons::group_addons()
197
*
198
* @param array $addons List of addons ([addon_name] => (array) [addon_details])
199
* @return array A list of addons per group: [group_name] => (array) [group_addons], where [group_addons] is an array ([addon_name] => (array) [addon_details])
200
*/
201
public function group_addons( $addons ) {
202
203
- $groups = $this->get_addon_groups();
204
$grouped_addons = array();
205
206
foreach ( $addons as $addon_name => $addon ) {
@@ -214,6 +222,7 @@ class CPAC_Addons {
214
215
$grouped_addons[ $addon['group'] ][ $addon_name ] = $addon;
216
}
217
return $grouped_addons;
218
}
219
@@ -223,6 +232,7 @@ class CPAC_Addons {
223
* @since 2.2
224
*
225
* @param string $slug Plugin dirname/slug
226
* @return bool Returns true if there is no add-on installed with the passed ID, false otherwise
227
*/
228
public function is_addon_installed( $slug ) {
@@ -236,6 +246,7 @@ class CPAC_Addons {
236
* @since 2.2
237
*
238
* @param string $slug Plugin dirname/slug
239
* @return string|bool Returns the plugin basename if the plugin is installed, false otherwise
240
*/
241
public function get_installed_addon_plugin_basename( $slug ) {
@@ -255,6 +266,7 @@ class CPAC_Addons {
255
* @since 2.2
256
*
257
* @param string $slug Plugin dirname/slug
258
* @return string|bool Returns the plugin version if the plugin is installed, false otherwise
259
*/
260
public function get_installed_addon_plugin_version( $slug ) {
@@ -269,4 +281,4 @@ class CPAC_Addons {
269
270
return false;
271
}
272
- }
1
<?php
2
+
3
class CPAC_Addons {
4
5
/**
34
*/
35
public function handle_install_request() {
36
37
+ if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'install-cac-addon' ) || ! isset( $_GET['plugin'] ) ) {
38
return;
39
+ }
40
41
if ( ! $this->get_addon( $_GET['plugin'] ) ) {
42
cpac_admin_message( 'Addon does not exist.', 'error' );
43
+
44
return;
45
}
46
47
if ( ! class_exists( 'CAC_Addon_Pro', false ) ) {
48
cpac_admin_message( 'You need Admin Columns Pro.', 'error' );
49
+
50
return;
51
}
52
53
// Hook: trigger possible warning message before running WP installer ( api errors etc. )
54
if ( $error = apply_filters( 'cac/addons/install_request/maybe_error', false, $_GET['plugin'] ) ) {
55
cpac_admin_message( $error, 'error' );
56
+
57
return;
58
}
59
60
$install_url = add_query_arg( array(
61
+ 'action' => 'install-plugin',
62
+ 'plugin' => $_GET['plugin'],
63
'cpac-redirect' => true
64
+ ), wp_nonce_url( network_admin_url( 'update.php' ), 'install-plugin_' . $_GET['plugin'] ) );
65
66
wp_redirect( $install_url );
67
exit;
131
* @since 2.2
132
*
133
* @param bool $grouped Whether to group the plugins by addon group ()
134
+ *
135
* @return array Available addons ([addon_basename] => (array) [addon_details] if not grouped, a list of these key-value pairs per group otherwise ([group_name] => (array) [group_addons]))
136
*/
137
public function get_available_addons( $grouped = false ) {
138
139
$addons = array(
140
+ 'cac-addon-acf' => array(
141
+ 'title' => __( 'Advanced Custom Fields', 'codepress-admin-columns' ),
142
+ 'description' => __( 'Display and edit Advanced Custom Fields fields in the posts overview in seconds!', 'codepress-admin-columns' ),
143
+ 'group' => 'integration',
144
+ 'image' => CPAC_URL . 'assets/images/addons/acf.png'
145
),
146
'cac-addon-woocommerce' => array(
147
+ 'title' => __( 'WooCommerce', 'codepress-admin-columns' ),
148
+ 'description' => __( 'Enhance the products, orders and coupons overviews with new columns and inline editing.', 'codepress-admin-columns' ),
149
+ 'group' => 'integration',
150
+ 'image' => CPAC_URL . 'assets/images/addons/woocommerce.png'
151
)
152
);
153
162
163
foreach ( $addons as $addon_name => $addon ) {
164
$addons[ $addon_name ] = wp_parse_args( $addon, array(
165
+ 'title' => '',
166
+ 'group' => '',
167
+ 'image' => ''
168
) );
169
}
170
182
* @since 2.2
183
*
184
* @param string $id Unique addon ID
185
+ *
186
* @return bool|array Returns addon details if the add-on exists, false otherwise
187
*/
188
public function get_addon( $id ) {
203
* @uses CPAC_Addons::group_addons()
204
*
205
* @param array $addons List of addons ([addon_name] => (array) [addon_details])
206
+ *
207
* @return array A list of addons per group: [group_name] => (array) [group_addons], where [group_addons] is an array ([addon_name] => (array) [addon_details])
208
*/
209
public function group_addons( $addons ) {
210
211
+ $groups = $this->get_addon_groups();
212
$grouped_addons = array();
213
214
foreach ( $addons as $addon_name => $addon ) {
222
223
$grouped_addons[ $addon['group'] ][ $addon_name ] = $addon;
224
}
225
+
226
return $grouped_addons;
227
}
228
232
* @since 2.2
233
*
234
* @param string $slug Plugin dirname/slug
235
+ *
236
* @return bool Returns true if there is no add-on installed with the passed ID, false otherwise
237
*/
238
public function is_addon_installed( $slug ) {
246
* @since 2.2
247
*
248
* @param string $slug Plugin dirname/slug
249
+ *
250
* @return string|bool Returns the plugin basename if the plugin is installed, false otherwise
251
*/
252
public function get_installed_addon_plugin_basename( $slug ) {
266
* @since 2.2
267
*
268
* @param string $slug Plugin dirname/slug
269
+ *
270
* @return string|bool Returns the plugin version if the plugin is installed, false otherwise
271
*/
272
public function get_installed_addon_plugin_version( $slug ) {
281
282
return false;
283
}
284
+ }
classes/column.php CHANGED
@@ -39,6 +39,11 @@ class CPAC_Column {
39
*/
40
protected $filtering_model;
41
42
/**
43
* @since 2.0
44
*
@@ -63,15 +68,6 @@ class CPAC_Column {
63
*/
64
protected function display_settings() {}
65
66
- /**
67
- * Get the sorting value. This value will be used to sort the column.
68
- *
69
- * @since 2.3.2
70
- * @param int $id Object ID
71
- * @return string Value for sorting
72
- */
73
- public function get_sorting_value( $id ) {}
74
-
75
/**
76
* Overwrite this function in child class to sanitize
77
* user submitted values.
@@ -277,7 +273,6 @@ class CPAC_Column {
277
*/
278
public function set_filter( $filtering_model ) {
279
$this->filtering_model = $filtering_model;
280
-
281
return $this;
282
}
283
@@ -288,6 +283,21 @@ class CPAC_Column {
288
return $this->filtering_model;
289
}
290
291
/**
292
* @param int $id
293
* @return object
@@ -354,6 +364,16 @@ class CPAC_Column {
354
return isset( $this->options->{$name} ) ? $this->options->{$name} : false;
355
}
356
357
/**
358
* Checks column type
359
*
@@ -398,7 +418,10 @@ class CPAC_Column {
398
* @return void
399
*/
400
public function attr_name( $field_name ) {
401
- echo "{$this->storage_model->key}[{$this->properties->name}][{$field_name}]";
402
}
403
404
/**
@@ -531,6 +554,17 @@ class CPAC_Column {
531
return $term_field;
532
}
533
534
/**
535
* @since 1.0
536
* @param int $post_id Post ID
@@ -1193,12 +1227,15 @@ class CPAC_Column {
1193
* @param string $label Label
1194
* @param array $options Select options
1195
* @param strong $description (optional) Description below the label
1196
*/
1197
- public function display_field_select( $name, $label, $options = array(), $description = '', $optional_toggle_id = '' ) {
1198
$current = $this->get_option( $name );
1199
$data_optional = $optional_toggle_id ? ' data-additional-option-id="' . $this->get_attr_id( $optional_toggle_id ) . '"' : '';
1200
?>
1201
- <tr class="column-<?php echo $name; ?>" <?php echo $data_optional; ?>>
1202
<?php $this->label_view( $label, $description, $name ); ?>
1203
<td class="input">
1204
<select name="<?php $this->attr_name( $name ); ?>" id="<?php $this->attr_id( $name ); ?>">
@@ -1229,6 +1266,21 @@ class CPAC_Column {
1229
<?php
1230
}
1231
1232
/**
1233
* @since 2.4.7
1234
*
@@ -1268,8 +1320,6 @@ class CPAC_Column {
1268
return false;
1269
}
1270
1271
- $list = '';
1272
-
1273
// sort by alphabet
1274
$_columns = array();
1275
39
*/
40
protected $filtering_model;
41
42
+ /**
43
+ * @since 2.4.8
44
+ */
45
+ protected $editable_model;
46
+
47
/**
48
* @since 2.0
49
*
68
*/
69
protected function display_settings() {}
70
71
/**
72
* Overwrite this function in child class to sanitize
73
* user submitted values.
273
*/
274
public function set_filter( $filtering_model ) {
275
$this->filtering_model = $filtering_model;
276
return $this;
277
}
278
283
return $this->filtering_model;
284
}
285
286
+ /**
287
+ * @since 2.4.8
288
+ */
289
+ public function set_editable( $editable_model ) {
290
+ $this->editable_model = $editable_model;
291
+ return $this;
292
+ }
293
+
294
+ /**
295
+ * @since 2.4.8
296
+ */
297
+ public function get_editable() {
298
+ return $this->editable_model;
299
+ }
300
+
301
/**
302
* @param int $id
303
* @return object
364
return isset( $this->options->{$name} ) ? $this->options->{$name} : false;
365
}
366
367
+ /**
368
+ * Get a single column option
369
+ *
370
+ * @since 2.4.8
371
+ * @return array Column options set by user
372
+ */
373
+ public function get_property( $name ) {
374
+ return isset( $this->properties->{$name} ) ? $this->properties->{$name} : false;
375
+ }
376
+
377
/**
378
* Checks column type
379
*
418
* @return void
419
*/
420
public function attr_name( $field_name ) {
421
+ echo $this->get_attr_name( $field_name );
422
+ }
423
+ public function get_attr_name( $field_name ) {
424
+ return "{$this->storage_model->key}[{$this->properties->name}][{$field_name}]";
425
}
426
427
/**
554
return $term_field;
555
}
556
557
+ // since 2.4.8
558
+ public function get_raw_post_field( $field, $id ) {
559
+ global $wpdb;
560
+ return $id ? $wpdb->get_var( $wpdb->prepare( "SELECT " . $wpdb->_real_escape( $field ) . " FROM {$wpdb->posts} WHERE ID = %d LIMIT 1", $id ) ) : false;
561
+ }
562
+
563
+ // since 2.4.8
564
+ public function get_post_title( $id ) {
565
+ return esc_html( $this->get_raw_post_field( 'post_title', $id ) );
566
+ }
567
+
568
/**
569
* @since 1.0
570
* @param int $post_id Post ID
1227
* @param string $label Label
1228
* @param array $options Select options
1229
* @param strong $description (optional) Description below the label
1230
+ * @param string $optional_toggle_id (optional) Toggle ID will hide the row untill the toggle is triggered
1231
+ * @param boolean $refresh This will JS refresh the column on change.
1232
*/
1233
+ public function display_field_select( $name, $label, $options = array(), $description = '', $optional_toggle_id = '', $js_refresh = false ) {
1234
$current = $this->get_option( $name );
1235
$data_optional = $optional_toggle_id ? ' data-additional-option-id="' . $this->get_attr_id( $optional_toggle_id ) . '"' : '';
1236
+ $data_refresh = $js_refresh ? ' data-refresh="1"' : '';
1237
?>
1238
+ <tr class="column-<?php echo $name; ?>"<?php echo $data_optional; ?><?php echo $data_refresh; ?>>
1239
<?php $this->label_view( $label, $description, $name ); ?>
1240
<td class="input">
1241
<select name="<?php $this->attr_name( $name ); ?>" id="<?php $this->attr_id( $name ); ?>">
1266
<?php
1267
}
1268
1269
+ /**
1270
+ * @since 2.4.8
1271
+ * @param string $name Name of the column option
1272
+ * @param string $value
1273
+ */
1274
+ public function display_field_hidden( $name, $value = '' ) {
1275
+ ?>
1276
+ <tr class="column-<?php echo $name; ?> hidden">
1277
+ <td class="input">
1278
+ <input type="hidden" name="<?php $this->attr_name( $name ); ?>" value="<?php echo esc_attr( $value ); ?>"/>
1279
+ </td>
1280
+ </tr>
1281
+ <?php
1282
+ }
1283
+
1284
/**
1285
* @since 2.4.7
1286
*
1320
return false;
1321
}
1322
1323
// sort by alphabet
1324
$_columns = array();
1325
classes/column/custom-field.php CHANGED
@@ -66,7 +66,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
66
* @since 3.2.1
67
*/
68
public function get_field() {
69
- return $this->options->field;
70
}
71
72
/**
@@ -139,10 +139,12 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
139
$ids = array();
140
141
// check for multiple id's
142
- if ( strpos( $meta, ',' ) !== false )
143
$ids = explode( ',', $meta );
144
- elseif ( is_numeric( $meta ) )
145
$ids[] = $meta;
146
147
return $ids;
148
}
@@ -155,21 +157,22 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
155
* @param string $meta
156
* @return string Titles
157
*/
158
- private function get_titles_by_id( $meta ) {
159
160
$titles = array();
161
162
// display title with link
163
- if ( $ids = $this->get_ids_from_meta( $meta ) ) {
164
foreach ( (array) $ids as $id ) {
165
166
if ( ! is_numeric( $id ) ) {
167
continue;
168
}
169
170
- $link = get_edit_post_link( $id );
171
- if ( $title = get_the_title( $id ) )
172
$titles[] = $link ? "<a href='{$link}'>{$title}</a>" : $title;
173
}
174
}
175
@@ -382,6 +385,34 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
382
return $this->storage_model->get_meta_keys();
383
}
384
385
/**
386
* @see CPAC_Column::display_settings()
387
* @since 1.0
@@ -390,21 +421,18 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
390
<tr class="column_field">
391
<?php $this->label_view( __( "Custom Field", 'codepress-admin-columns' ), __( "Select your custom field.", 'codepress-admin-columns' ), 'field' ); ?>
392
<td class="input">
393
-
394
- <?php if ( $meta_keys = $this->get_meta_keys() ) : ?>
395
- <select name="<?php $this->attr_name( 'field' ); ?>" id="<?php $this->attr_id( 'field' ); ?>">
396
- <?php foreach ( $meta_keys as $field ) : ?>
397
- <option value="<?php echo $field ?>"<?php selected( $field, $this->options->field ) ?>><?php echo substr( $field, 0, 10 ) == "cpachidden" ? str_replace( 'cpachidden', '', $field ) : $field; ?></option>
398
- <?php endforeach; ?>
399
- </select>
400
- <?php else : ?>
401
- <?php _e( 'No custom fields available.', 'codepress-admin-columns' ); ?> <?php printf( __( 'Please create a %s item first.', 'codepress-admin-columns' ), '<em>' . $this->storage_model->singular_label . '</em>' ); ?>
402
- <?php endif; ?>
403
-
404
</td>
405
</tr>
406
407
- <tr class="column_field_type">
408
<?php $this->label_view( __( "Field Type", 'codepress-admin-columns' ), __( 'This will determine how the value will be displayed.', 'codepress-admin-columns' ) . '<em>' . __( 'Type', 'codepress-admin-columns' ) . ': ' . $this->options->field_type . '</em>', 'field_type' ); ?>
409
<td class="input">
410
<select name="<?php $this->attr_name( 'field_type' ); ?>" id="<?php $this->attr_id( 'field_type' ); ?>">
@@ -431,5 +459,4 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
431
432
$this->display_field_before_after();
433
}
434
-
435
}
66
* @since 3.2.1
67
*/
68
public function get_field() {
69
+ return $this->get_field_key();
70
}
71
72
/**
139
$ids = array();
140
141
// check for multiple id's
142
+ if ( strpos( $meta, ',' ) !== false ) {
143
$ids = explode( ',', $meta );
144
+ }
145
+ elseif ( is_numeric( $meta ) ) {
146
$ids[] = $meta;
147
+ }
148
149
return $ids;
150
}
157
* @param string $meta
158
* @return string Titles
159
*/
160
+ private function get_titles_by_id( $ids ) {
161
162
$titles = array();
163
164
// display title with link
165
+ if ( $ids = $this->get_ids_from_meta( $ids ) ) {
166
foreach ( (array) $ids as $id ) {
167
168
if ( ! is_numeric( $id ) ) {
169
continue;
170
}
171
172
+ if ( $title = $this->get_post_title( $id ) ) {
173
+ $link = get_edit_post_link( $id );
174
$titles[] = $link ? "<a href='{$link}'>{$title}</a>" : $title;
175
+ }
176
}
177
}
178
385
return $this->storage_model->get_meta_keys();
386
}
387
388
+ public function get_meta_keys_list() {
389
+ $list = false;
390
+
391
+ if ( $keys = $this->get_meta_keys() ) {
392
+ $lists = array();
393
+ foreach ( $keys as $field ) {
394
+ if ( substr( $field, 0, 10 ) == "cpachidden" ) {
395
+ $lists['hidden'][] = $field;
396
+ } else {
397
+ $lists['public'][] = $field;
398
+ }
399
+ }
400
+ krsort( $lists ); // public first
401
+
402
+ $list = '<select name="' . $this->get_attr_name( 'field' ) . '" id="' . $this->get_attr_id( 'field' ) . '">';
403
+ foreach ( $lists as $type => $fields ) {
404
+ $list .= "<optgroup label='" . ( 'hidden' == $type ? __( 'Hidden Custom Fields', 'codepress-admin-columns' ) : __( 'Custom Fields', 'codepress-admin-columns' ) ) . "'>";
405
+ foreach ( $fields as $field ) {
406
+ $list .= "<option value='{$field}'" . selected( $field, $this->options->field, false ) . ">" . str_replace( 'cpachidden', '', $field ) . "</option>";
407
+ }
408
+ $list .= "</optgroup>";
409
+ }
410
+ $list .= '</select>';
411
+ }
412
+
413
+ return $list;
414
+ }
415
+
416
/**
417
* @see CPAC_Column::display_settings()
418
* @since 1.0
421
<tr class="column_field">
422
<?php $this->label_view( __( "Custom Field", 'codepress-admin-columns' ), __( "Select your custom field.", 'codepress-admin-columns' ), 'field' ); ?>
423
<td class="input">
424
+ <?php
425
+ if ( $list = $this->get_meta_keys_list() ) {
426
+ echo $list;
427
+ }
428
+ else {
429
+ _e( 'No custom fields available.', 'codepress-admin-columns' ); ?> <?php printf( __( 'Please create a %s item first.', 'codepress-admin-columns' ), '<strong>' . $this->storage_model->singular_label . '</strong>' );
430
+ }
431
+ ?>
432
</td>
433
</tr>
434
435
+ <tr class="column_field_type" data-refresh="1">
436
<?php $this->label_view( __( "Field Type", 'codepress-admin-columns' ), __( 'This will determine how the value will be displayed.', 'codepress-admin-columns' ) . '<em>' . __( 'Type', 'codepress-admin-columns' ) . ': ' . $this->options->field_type . '</em>', 'field_type' ); ?>
437
<td class="input">
438
<select name="<?php $this->attr_name( 'field_type' ); ?>" id="<?php $this->attr_id( 'field_type' ); ?>">
459
460
$this->display_field_before_after();
461
}
462
}
classes/column/post/parent.php CHANGED
@@ -30,7 +30,7 @@ class CPAC_Column_Post_Parent extends CPAC_Column {
30
return false;
31
}
32
33
- $title = get_the_title( $parent_id );
34
$link = get_edit_post_link( $parent_id );
35
36
return $link ? "<a href='{$link}'>{$title}</a>" : $title;
@@ -41,14 +41,9 @@ class CPAC_Column_Post_Parent extends CPAC_Column {
41
* @since 2.0.3
42
*/
43
public function get_raw_value( $post_id ) {
44
45
- $parent_id = get_post_field( 'post_parent', $post_id );
46
-
47
- if ( ! $parent_id || ! is_numeric( $parent_id ) ) {
48
- return false;
49
- }
50
-
51
- return $parent_id;
52
}
53
54
/**
30
return false;
31
}
32
33
+ $title = $this->get_post_title( $parent_id );
34
$link = get_edit_post_link( $parent_id );
35
36
return $link ? "<a href='{$link}'>{$title}</a>" : $title;
41
* @since 2.0.3
42
*/
43
public function get_raw_value( $post_id ) {
44
+ $parent_id = $this->get_raw_post_field( 'post_parent', $post_id );
45
46
+ return $parent_id && is_numeric( $parent_id ) ? $parent_id : false;
47
}
48
49
/**
classes/column/post/ping-status.php CHANGED
@@ -16,7 +16,7 @@ class CPAC_Column_Post_Ping_Status extends CPAC_Column {
16
17
// Properties
18
$this->properties['type'] = 'column-ping_status';
19
- $this->properties['label'] = __( 'Ping status', 'codepress-admin-columns' );
20
$this->properties['object_property'] = 'ping_status';
21
}
22
16
17
// Properties
18
$this->properties['type'] = 'column-ping_status';
19
+ $this->properties['label'] = __( 'Ping Status', 'codepress-admin-columns' );
20
$this->properties['object_property'] = 'ping_status';
21
}
22
classes/column/post/status.php CHANGED
@@ -21,6 +21,11 @@ class CPAC_Column_Post_Status extends CPAC_Column {
21
$this->properties['label'] = __( 'Status', 'codepress-admin-columns' );
22
}
23
24
/**
25
* Get Statuses
26
*/
21
$this->properties['label'] = __( 'Status', 'codepress-admin-columns' );
22
}
23
24
+ public function get_status( $name ) {
25
+ $stati = $this->get_statuses();
26
+ return isset( $stati[ $name ] ) ? $stati[ $name ] : false;
27
+ }
28
+
29
/**
30
* Get Statuses
31
*/
classes/settings.php CHANGED
@@ -767,7 +767,7 @@ class CPAC_Settings {
767
'hashtags' => 'admincolumns',
768
'text' => urlencode( "I'm using Admin Columns for WordPress!" ),
769
'url' => urlencode( 'http://wordpress.org/plugins/codepress-admin-columns/' ),
770
- //'via' => 'wpcolumns'
771
), 'https://twitter.com/intent/tweet' ); ?>" target="_blank">
772
<div class="dashicons dashicons-twitter"></div> <?php _e( 'Tweet', 'codepress-admin-columns' ); ?>
773
</a>
767
'hashtags' => 'admincolumns',
768
'text' => urlencode( "I'm using Admin Columns for WordPress!" ),
769
'url' => urlencode( 'http://wordpress.org/plugins/codepress-admin-columns/' ),
770
+ 'via' => 'codepressNL'
771
), 'https://twitter.com/intent/tweet' ); ?>" target="_blank">
772
<div class="dashicons dashicons-twitter"></div> <?php _e( 'Tweet', 'codepress-admin-columns' ); ?>
773
</a>
classes/storage_model.php CHANGED
@@ -11,7 +11,7 @@ abstract class CPAC_Storage_Model {
11
* @since 2.0
12
*/
13
public $label;
14
-
15
/**
16
* @since 2.3.5
17
*/
@@ -46,7 +46,7 @@ abstract class CPAC_Storage_Model {
46
public $menu_type;
47
48
/**
49
- * @since NEWVERSIOM
50
*/
51
private $column_headings;
52
@@ -92,7 +92,7 @@ abstract class CPAC_Storage_Model {
92
* @since 2.2
93
* @var array
94
*/
95
- public $stored_columns = NULL;
96
97
/**
98
* @since 2.2
@@ -130,6 +130,7 @@ abstract class CPAC_Storage_Model {
130
*/
131
public function set_menu_type( $menu_type ) {
132
$this->menu_type = $menu_type;
133
return $this;
134
}
135
@@ -137,7 +138,9 @@ abstract class CPAC_Storage_Model {
137
* Checks if menu type is currently viewed
138
*
139
* @since 1.0
140
* @param string $key
141
* @return bool
142
*/
143
public function is_menu_type_current( $first_posttype ) {
@@ -147,9 +150,7 @@ abstract class CPAC_Storage_Model {
147
if ( $_REQUEST['cpac_key'] == $this->key ) {
148
return true;
149
}
150
- }
151
-
152
- // settings page has not yet been saved
153
elseif ( $first_posttype == $this->key ) {
154
return true;
155
}
@@ -169,13 +170,12 @@ abstract class CPAC_Storage_Model {
169
// give hidden keys a prefix for identifaction
170
if ( $add_hidden_meta && "_" == substr( $key[0], 0, 1 ) ) {
171
$formatted_keys[] = 'cpachidden' . $key[0];
172
- }
173
-
174
- // non hidden keys are saved as is
175
elseif ( "_" != substr( $key[0], 0, 1 ) ) {
176
$formatted_keys[] = $key[0];
177
}
178
}
179
return $formatted_keys;
180
}
181
@@ -187,16 +187,14 @@ abstract class CPAC_Storage_Model {
187
188
if ( $cache = wp_cache_get( $this->key, 'cac_columns' ) ) {
189
$keys = $cache;
190
- }
191
- else {
192
$keys = $this->get_meta();
193
wp_cache_add( $this->key, $keys, 'cac_columns', 10 ); // 10 sec.
194
}
195
196
if ( is_wp_error( $keys ) || empty( $keys ) ) {
197
$keys = false;
198
- }
199
- else {
200
$keys = $this->format_meta_keys( $keys );
201
}
202
@@ -222,7 +220,9 @@ abstract class CPAC_Storage_Model {
222
223
/**
224
* @since 2.0
225
* @param array $fields Custom fields.
226
* @return array Custom fields.
227
*/
228
protected function add_hidden_meta( $fields ) {
@@ -237,17 +237,16 @@ abstract class CPAC_Storage_Model {
237
238
// give hidden fields a prefix for identifaction
239
if ( "_" == substr( $field[0], 0, 1 ) ) {
240
- $combined_fields[] = 'cpachidden'.$field[0];
241
- }
242
-
243
- // non hidden fields are saved as is
244
elseif ( "_" != substr( $field[0], 0, 1 ) ) {
245
$combined_fields[] = $field[0];
246
}
247
}
248
249
- if ( empty( $combined_fields ) )
250
return false;
251
252
return $combined_fields;
253
}
@@ -259,7 +258,7 @@ abstract class CPAC_Storage_Model {
259
260
delete_option( "cpac_options_{$this->key}" );
261
262
- cpac_admin_message( "<strong>{$this->label}</strong> " . __( 'settings succesfully restored.', 'codepress-admin-columns' ), 'updated' );
263
264
// refresh columns otherwise the removed columns will still display
265
$this->set_columns_on_current_screen();
@@ -275,7 +274,8 @@ abstract class CPAC_Storage_Model {
275
}
276
277
if ( ! $columns ) {
278
- cpac_admin_message( __( 'No columns settings available.', 'codepress-admin-columns' ), 'error' );
279
return false;
280
}
281
@@ -291,16 +291,17 @@ abstract class CPAC_Storage_Model {
291
}
292
293
// store columns
294
- $result = update_option( "cpac_options_{$this->key}", $columns );
295
$result_default = update_option( "cpac_options_{$this->key}_default", array_keys( $this->get_default_columns() ) );
296
297
// error
298
if ( ! $result && ! $result_default ) {
299
cpac_admin_message( sprintf( __( 'You are trying to store the same settings for %s.', 'codepress-admin-columns' ), "<strong>{$this->label}</strong>" ), 'error' );
300
return false;
301
}
302
303
- cpac_admin_message( sprintf( __( 'Settings for %s updated successfully.', 'codepress-admin-columns' ), "<strong>{$this->label}</strong>" ), 'updated' );
304
305
// refresh columns otherwise the newly added columns will not be displayed
306
$this->set_columns_on_current_screen();
@@ -327,10 +328,10 @@ abstract class CPAC_Storage_Model {
327
*/
328
public function set_columns_filepath() {
329
330
- $columns = array(
331
- 'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
332
- 'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php',
333
- 'CPAC_Column_Used_By_Menu' => CPAC_DIR . 'classes/column/used-by-menu.php'
334
);
335
336
// Add-on placeholders
@@ -338,12 +339,12 @@ abstract class CPAC_Storage_Model {
338
339
// Display ACF placeholder
340
if ( cpac_is_acf_active() ) {
341
- $columns[ 'CPAC_Column_ACF_Placeholder' ] = CPAC_DIR . 'classes/column/acf-placeholder.php';
342
}
343
344
// Display WooCommerce placeholder
345
if ( cpac_is_woocommerce_active() ) {
346
- $columns[ 'CPAC_Column_WC_Placeholder' ] = CPAC_DIR . 'classes/column/wc-placeholder.php';
347
}
348
}
349
@@ -351,19 +352,19 @@ abstract class CPAC_Storage_Model {
351
$columns_dir = CPAC_DIR . 'classes/column/' . $this->type;
352
if ( is_dir( $columns_dir ) ) {
353
$iterator = new DirectoryIterator( $columns_dir );
354
- foreach( $iterator as $leaf ) {
355
356
if ( $leaf->isDot() || $leaf->isDir() ) {
357
continue;
358
}
359
360
// only allow php files, exclude .SVN .DS_STORE and such
361
- if ( substr( $leaf->getFilename(), -4 ) !== '.php' ) {
362
continue;
363
}
364
365
// build classname from filename
366
- $class_name = 'CPAC_Column_' . ucfirst( $this->type ) . '_' . implode( '_', array_map( 'ucfirst', explode( '-', basename( $leaf->getFilename(), '.php' ) ) ) );
367
368
// classname | filepath
369
$columns[ $class_name ] = $leaf->getPathname();
@@ -375,6 +376,7 @@ abstract class CPAC_Storage_Model {
375
* Use this to register a custom column type
376
*
377
* @since 2.0
378
* @param array $columns Available custom columns ([class_name] => [class file path])
379
* @param CPAC_Storage_Model $storage_model Storage model class instance
380
*/
@@ -401,8 +403,10 @@ abstract class CPAC_Storage_Model {
401
402
/**
403
* @since 2.0
404
* @param $column_name
405
* @param $label
406
* @return object CPAC_Column
407
*/
408
public function create_column_instance( $column_name, $label ) {
@@ -421,7 +425,7 @@ abstract class CPAC_Storage_Model {
421
->set_options( 'state', 'on' );
422
423
// Hide Label when it contains HTML elements
424
- if( strlen( $label ) != strlen( strip_tags( $label ) ) ) {
425
$column->set_properties( 'hide_label', true );
426
}
427
@@ -455,20 +459,16 @@ abstract class CPAC_Storage_Model {
455
* @since 2.0
456
* @return array Column Type | Column Instance
457
*/
458
- public function get_default_registered_columns() {
459
460
$columns = array();
461
-
462
- // Default columns
463
foreach ( $this->get_default_columns() as $column_name => $label ) {
464
465
// checkboxes are mandatory
466
if ( 'cb' == $column_name ) {
467
continue;
468
}
469
-
470
$column = $this->create_column_instance( $column_name, $label );
471
-
472
$columns[ $column->properties->name ] = $column;
473
}
474
@@ -511,7 +511,9 @@ abstract class CPAC_Storage_Model {
511
512
/**
513
* @since 1.0
514
* @param string $key
515
* @return array Column options
516
*/
517
public function get_default_stored_columns() {
@@ -531,7 +533,7 @@ abstract class CPAC_Storage_Model {
531
532
$columns = $this->stored_columns;
533
534
- if ( $this->stored_columns === NULL ) {
535
$columns = $this->get_database_columns();
536
}
537
@@ -612,17 +614,17 @@ abstract class CPAC_Storage_Model {
612
613
do_action( 'cac/set_columns', $this );
614
615
- $this->custom_columns = $this->get_custom_registered_columns();
616
$this->default_columns = $this->get_default_registered_columns();
617
- $this->column_types = $this->get_grouped_column_types();
618
- $this->columns = $this->get_columns();
619
620
do_action( 'cac/set_columns/after', $this );
621
}
622
623
public function get_grouped_column_types() {
624
625
- $types = array();
626
$groups = array_keys( $this->get_column_type_groups() );
627
628
$columns = array_merge( $this->default_columns, $this->custom_columns );
@@ -646,12 +648,12 @@ abstract class CPAC_Storage_Model {
646
public function get_column_type_groups() {
647
648
$groups = array(
649
- 'default' => __( 'Default', 'codepress-admin-columns' ),
650
'custom-field' => __( 'Custom Field', 'codepress-admin-columns' ),
651
- 'custom' => __( 'Custom', 'codepress-admin-columns' ),
652
- 'plugin' => __( 'Columns by Plugins', 'codepress-admin-columns' ),
653
- 'acf' => __( 'Advanced Custom Fields', 'codepress-admin-columns' ),
654
- 'woocommerce' => __( 'WooCommerce', 'codepress-admin-columns' )
655
);
656
657
/**
@@ -676,15 +678,18 @@ abstract class CPAC_Storage_Model {
676
foreach ( $this->column_types as $grouptypes ) {
677
$types = array_merge( $types, $grouptypes );
678
}
679
return $types;
680
}
681
682
/**
683
* @since 2.3.4
684
* @param string Column Type
685
*/
686
public function get_registered_column( $column_type ) {
687
$columns = $this->get_registered_columns();
688
return isset( $columns[ $column_type ] ) ? $columns[ $column_type ] : false;
689
}
690
@@ -700,7 +705,7 @@ abstract class CPAC_Storage_Model {
700
// get columns
701
$default_columns = $this->get_default_columns();
702
703
- // @todo check if this solves the issue with not displaying value when using "manage_{$post_type}_posts_columns" at CPAC_Storage_Model_Post
704
$registered_columns = $this->get_registered_columns();
705
706
if ( $stored_columns = $this->get_stored_columns() ) {
@@ -753,8 +758,7 @@ abstract class CPAC_Storage_Model {
753
$columns[ $name ] = clone $registered_columns[ $name ];
754
}
755
}
756
- }
757
- // When nothing has been saved yet, we return the default WP columns.
758
else {
759
foreach ( array_keys( $default_columns ) as $name ) {
760
if ( isset( $registered_columns[ $name ] ) ) {
@@ -832,6 +836,7 @@ abstract class CPAC_Storage_Model {
832
* Label needs stripslashes() for HTML tagged labels, like icons and checkboxes
833
*
834
* @since 2.0
835
* @param string $label Label
836
* @param string $column_name Column name
837
* @param array $options Column options
@@ -870,7 +875,7 @@ abstract class CPAC_Storage_Model {
870
public function screen_link() {
871
872
if ( $link = $this->get_screen_link() ) {
873
- echo '<a href="' . $link . '" class="add-new-h2">' . __('View', 'codepress-admin-columns') . '</a>';
874
}
875
}
876
@@ -879,7 +884,9 @@ abstract class CPAC_Storage_Model {
879
*/
880
public function get_edit_link() {
881
882
- return add_query_arg( array( 'page' => 'codepress-admin-columns', 'cpac_key' => $this->key ), admin_url( 'options-general.php' ) );
883
}
884
885
/**
@@ -961,8 +968,9 @@ abstract class CPAC_Storage_Model {
961
public function get_general_option( $option ) {
962
$options = get_option( 'cpac_general_options' );
963
964
- if ( ! isset( $options[ $option ] ) )
965
return false;
966
967
return $options[ $option ];
968
}
11
* @since 2.0
12
*/
13
public $label;
14
+
15
/**
16
* @since 2.3.5
17
*/
46
public $menu_type;
47
48
/**
49
+ * @since 2.4.3
50
*/
51
private $column_headings;
52
92
* @since 2.2
93
* @var array
94
*/
95
+ public $stored_columns = null;
96
97
/**
98
* @since 2.2
130
*/
131
public function set_menu_type( $menu_type ) {
132
$this->menu_type = $menu_type;
133
+
134
return $this;
135
}
136
138
* Checks if menu type is currently viewed
139
*
140
* @since 1.0
141
+ *
142
* @param string $key
143
+ *
144
* @return bool
145
*/
146
public function is_menu_type_current( $first_posttype ) {
150
if ( $_REQUEST['cpac_key'] == $this->key ) {
151
return true;
152
}
153
+ } // settings page has not yet been saved
154
elseif ( $first_posttype == $this->key ) {
155
return true;
156
}
170
// give hidden keys a prefix for identifaction
171
if ( $add_hidden_meta && "_" == substr( $key[0], 0, 1 ) ) {
172
$formatted_keys[] = 'cpachidden' . $key[0];
173
+ } // non hidden keys are saved as is
174
elseif ( "_" != substr( $key[0], 0, 1 ) ) {
175
$formatted_keys[] = $key[0];
176
}
177
}
178
+
179
return $formatted_keys;
180
}
181
187
188
if ( $cache = wp_cache_get( $this->key, 'cac_columns' ) ) {
189
$keys = $cache;
190
+ } else {
191
$keys = $this->get_meta();
192
wp_cache_add( $this->key, $keys, 'cac_columns', 10 ); // 10 sec.
193
}
194
195
if ( is_wp_error( $keys ) || empty( $keys ) ) {
196
$keys = false;
197
+ } else {
198
$keys = $this->format_meta_keys( $keys );
199
}
200
220
221
/**
222
* @since 2.0
223
+ *
224
* @param array $fields Custom fields.
225
+ *
226
* @return array Custom fields.
227
*/
228
protected function add_hidden_meta( $fields ) {
237
238
// give hidden fields a prefix for identifaction
239
if ( "_" == substr( $field[0], 0, 1 ) ) {
240
+ $combined_fields[] = 'cpachidden' . $field[0];
241
+ } // non hidden fields are saved as is
242
elseif ( "_" != substr( $field[0], 0, 1 ) ) {
243
$combined_fields[] = $field[0];
244
}
245
}
246
247
+ if ( empty( $combined_fields ) ) {
248
return false;
249
+ }
250
251
return $combined_fields;
252
}
258
259
delete_option( "cpac_options_{$this->key}" );
260
261
+ cpac_admin_message( "<strong>{$this->label}</strong> " . __( 'settings succesfully restored.', 'codepress-admin-columns' ), 'updated' );
262
263
// refresh columns otherwise the removed columns will still display
264
$this->set_columns_on_current_screen();
274
}
275
276
if ( ! $columns ) {
277
+ cpac_admin_message( __( 'No columns settings available.', 'codepress-admin-columns' ), 'error' );
278
+
279
return false;
280
}
281
291
}
292
293
// store columns
294
+ $result = update_option( "cpac_options_{$this->key}", $columns );
295
$result_default = update_option( "cpac_options_{$this->key}_default", array_keys( $this->get_default_columns() ) );
296
297
// error
298
if ( ! $result && ! $result_default ) {
299
cpac_admin_message( sprintf( __( 'You are trying to store the same settings for %s.', 'codepress-admin-columns' ), "<strong>{$this->label}</strong>" ), 'error' );
300
+
301
return false;
302
}
303
304
+ cpac_admin_message( sprintf( __( 'Settings for %s updated successfully.', 'codepress-admin-columns' ), "<strong>{$this->label}</strong>" ), 'updated' );
305
306
// refresh columns otherwise the newly added columns will not be displayed
307
$this->set_columns_on_current_screen();
328
*/
329
public function set_columns_filepath() {
330
331
+ $columns = array(
332
+ 'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
333
+ 'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php',
334
+ 'CPAC_Column_Used_By_Menu' => CPAC_DIR . 'classes/column/used-by-menu.php'
335
);
336
337
// Add-on placeholders
339
340
// Display ACF placeholder
341
if ( cpac_is_acf_active() ) {
342
+ $columns['CPAC_Column_ACF_Placeholder'] = CPAC_DIR . 'classes/column/acf-placeholder.php';
343
}
344
345
// Display WooCommerce placeholder
346
if ( cpac_is_woocommerce_active() ) {
347
+ $columns['CPAC_Column_WC_Placeholder'] = CPAC_DIR . 'classes/column/wc-placeholder.php';
348
}
349
}
350
352
$columns_dir = CPAC_DIR . 'classes/column/' . $this->type;
353
if ( is_dir( $columns_dir ) ) {
354
$iterator = new DirectoryIterator( $columns_dir );
355
+ foreach ( $iterator as $leaf ) {
356
357
if ( $leaf->isDot() || $leaf->isDir() ) {
358
continue;
359
}
360
361
// only allow php files, exclude .SVN .DS_STORE and such
362
+ if ( substr( $leaf->getFilename(), - 4 ) !== '.php' ) {
363
continue;
364
}
365
366
// build classname from filename
367
+ $class_name = 'CPAC_Column_' . ucfirst( $this->type ) . '_' . implode( '_', array_map( 'ucfirst', explode( '-', basename( $leaf->getFilename(), '.php' ) ) ) );
368
369
// classname | filepath
370
$columns[ $class_name ] = $leaf->getPathname();
376
* Use this to register a custom column type
377
*
378
* @since 2.0
379
+ *
380
* @param array $columns Available custom columns ([class_name] => [class file path])
381
* @param CPAC_Storage_Model $storage_model Storage model class instance
382
*/
403
404
/**
405
* @since 2.0
406
+ *
407
* @param $column_name
408
* @param $label
409
+ *
410
* @return object CPAC_Column
411
*/
412
public function create_column_instance( $column_name, $label ) {
425
->set_options( 'state', 'on' );
426
427
// Hide Label when it contains HTML elements
428
+ if ( strlen( $label ) != strlen( strip_tags( $label ) ) ) {
429
$column->set_properties( 'hide_label', true );
430
}
431
459
* @since 2.0
460
* @return array Column Type | Column Instance
461
*/
462
+ private function get_default_registered_columns() {
463
464
$columns = array();
465
foreach ( $this->get_default_columns() as $column_name => $label ) {
466
467
// checkboxes are mandatory
468
if ( 'cb' == $column_name ) {
469
continue;
470
}
471
$column = $this->create_column_instance( $column_name, $label );
472
$columns[ $column->properties->name ] = $column;
473
}
474
511
512
/**
513
* @since 1.0
514
+ *
515
* @param string $key
516
+ *
517
* @return array Column options
518
*/
519
public function get_default_stored_columns() {
533
534
$columns = $this->stored_columns;
535
536
+ if ( $this->stored_columns === null ) {
537
$columns = $this->get_database_columns();
538
}
539
614
615
do_action( 'cac/set_columns', $this );
616
617
+ $this->custom_columns = $this->get_custom_registered_columns();
618
$this->default_columns = $this->get_default_registered_columns();
619
+ $this->column_types = $this->get_grouped_column_types();
620
+ $this->columns = $this->get_columns();
621
622
do_action( 'cac/set_columns/after', $this );
623
}
624
625
public function get_grouped_column_types() {
626
627
+ $types = array();
628
$groups = array_keys( $this->get_column_type_groups() );
629
630
$columns = array_merge( $this->default_columns, $this->custom_columns );
648
public function get_column_type_groups() {
649
650
$groups = array(
651
+ 'default' => __( 'Default', 'codepress-admin-columns' ),
652
'custom-field' => __( 'Custom Field', 'codepress-admin-columns' ),
653
+ 'custom' => __( 'Custom', 'codepress-admin-columns' ),
654
+ 'plugin' => __( 'Columns by Plugins', 'codepress-admin-columns' ),
655
+ 'acf' => __( 'Advanced Custom Fields', 'codepress-admin-columns' ),
656
+ 'woocommerce' => __( 'WooCommerce', 'codepress-admin-columns' )
657
);
658
659
/**
678
foreach ( $this->column_types as $grouptypes ) {
679
$types = array_merge( $types, $grouptypes );
680
}
681
+
682
return $types;
683
}
684
685
/**
686
* @since 2.3.4
687
+ *
688
* @param string Column Type
689
*/
690
public function get_registered_column( $column_type ) {
691
$columns = $this->get_registered_columns();
692
+
693
return isset( $columns[ $column_type ] ) ? $columns[ $column_type ] : false;
694
}
695
705
// get columns
706
$default_columns = $this->get_default_columns();
707
708
+ // TODO check if this solves the issue with not displaying value when using "manage_{$post_type}_posts_columns" at CPAC_Storage_Model_Post
709
$registered_columns = $this->get_registered_columns();
710
711
if ( $stored_columns = $this->get_stored_columns() ) {
758
$columns[ $name ] = clone $registered_columns[ $name ];
759
}
760
}
761
+ } // When nothing has been saved yet, we return the default WP columns.
762
else {
763
foreach ( array_keys( $default_columns ) as $name ) {
764
if ( isset( $registered_columns[ $name ] ) ) {
836
* Label needs stripslashes() for HTML tagged labels, like icons and checkboxes
837
*
838
* @since 2.0
839
+ *
840
* @param string $label Label
841
* @param string $column_name Column name
842
* @param array $options Column options
875
public function screen_link() {
876
877
if ( $link = $this->get_screen_link() ) {
878
+ echo '<a href="' . $link . '" class="add-new-h2">' . __( 'View', 'codepress-admin-columns' ) . '</a>';
879
}
880
}
881
884
*/
885
public function get_edit_link() {
886
887
+ return add_query_arg( array( 'page' => 'codepress-admin-columns',
888
+ 'cpac_key' => $this->key
889
+ ), admin_url( 'options-general.php' ) );
890
}
891
892
/**
968
public function get_general_option( $option ) {
969
$options = get_option( 'cpac_general_options' );
970
971
+ if ( ! isset( $options[ $option ] ) ) {
972
return false;
973
+ }
974
975
return $options[ $option ];
976
}
classes/storage_model/comment.php CHANGED
@@ -1,39 +1,32 @@
1
<?php
2
3
class CPAC_Storage_Model_Comment extends CPAC_Storage_Model {
4
5
- /**
6
- * Constructor
7
- *
8
- * @since 2.0
9
- */
10
- function __construct() {
11
12
- $this->key = 'wp-comments';
13
- $this->label = __( 'Comments' );
14
$this->singular_label = __( 'Comment' );
15
- $this->type = 'comment';
16
- $this->meta_type = 'comment';
17
- $this->page = 'edit-comments';
18
- $this->menu_type = 'other';
19
-
20
- // headings
21
- add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 ); // Filter is located in get_column_headers().
22
23
- // values
24
add_action( 'manage_comments_custom_column', array( $this, 'manage_value' ), 100, 2 );
25
26
parent::__construct();
27
}
28
29
/**
30
- * @since 2.3.4
31
* @see CPAC_Storage_Model::is_columns_screen()
32
*/
33
public function is_columns_screen() {
34
-
35
$is_columns_screen = parent::is_columns_screen();
36
-
37
if ( ! $is_columns_screen ) {
38
if ( ! empty( $_REQUEST['_ajax_nonce-replyto-comment'] ) && wp_verify_nonce( $_REQUEST['_ajax_nonce-replyto-comment'], 'replyto-comment' ) ) {
39
$is_columns_screen = true;
@@ -43,26 +36,12 @@ class CPAC_Storage_Model_Comment extends CPAC_Storage_Model {
43
return $is_columns_screen;
44
}
45
46
- /**
47
- * Get original columns
48
- *
49
- * @since 2.4.4
50
- */
51
public function get_default_column_names() {
52
return array( 'cb', 'author', 'comment', 'response' );
53
}
54
55
- /**
56
- * Get WP default supported admin columns per post type.
57
- *
58
- * @see CPAC_Type::get_default_columns()
59
- * @since 1.0
60
- *
61
- * @return array
62
- */
63
public function get_default_columns() {
64
-
65
- if ( ! function_exists('_get_list_table') ) {
66
return array();
67
}
68
@@ -71,38 +50,22 @@ class CPAC_Storage_Model_Comment extends CPAC_Storage_Model {
71
do_action( "cac/columns/default/storage_key={$this->key}" );
72
73
// get columns
74
- $table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'comments' ) );
75
- $columns = (array) $table->get_columns();
76
77
return $columns;
78
}
79
80
- /**
81
- * Get Meta
82
- *
83
- * @since 2.0
84
- *
85
- * @return array
86
- */
87
- public function get_meta() {
88
- global $wpdb;
89
return $wpdb->get_results( "SELECT DISTINCT meta_key FROM {$wpdb->commentmeta} ORDER BY 1", ARRAY_N );
90
- }
91
92
- /**
93
- * Manage value
94
- *
95
- * @since 2.0
96
- *
97
- * @param string $column_name
98
- * @param int $post_id
99
- */
100
public function manage_value( $column_name, $comment_id ) {
101
-
102
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
103
return false;
104
}
105
-
106
$value = $column->get_value( $comment_id );
107
108
// hook
@@ -111,5 +74,4 @@ class CPAC_Storage_Model_Comment extends CPAC_Storage_Model {
111
112
echo $value;
113
}
114
-
115
- }
1
<?php
2
3
+ /**
4
+ * @since 2.0
5
+ */
6
class CPAC_Storage_Model_Comment extends CPAC_Storage_Model {
7
8
+ public function __construct() {
9
10
+ $this->key = 'wp-comments';
11
+ $this->label = __( 'Comments' );
12
$this->singular_label = __( 'Comment' );
13
+ $this->type = 'comment';
14
+ $this->meta_type = 'comment';
15
+ $this->page = 'edit-comments';
16
+ $this->menu_type = 'other';
17
18
+ // Filter is located in get_column_headers().
19
+ add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 );
20
add_action( 'manage_comments_custom_column', array( $this, 'manage_value' ), 100, 2 );
21
22
parent::__construct();
23
}
24
25
/**
26
* @see CPAC_Storage_Model::is_columns_screen()
27
*/
28
public function is_columns_screen() {
29
$is_columns_screen = parent::is_columns_screen();
30
if ( ! $is_columns_screen ) {
31
if ( ! empty( $_REQUEST['_ajax_nonce-replyto-comment'] ) && wp_verify_nonce( $_REQUEST['_ajax_nonce-replyto-comment'], 'replyto-comment' ) ) {
32
$is_columns_screen = true;
36
return $is_columns_screen;
37
}
38
39
public function get_default_column_names() {
40
return array( 'cb', 'author', 'comment', 'response' );
41
}
42
43
public function get_default_columns() {
44
+ if ( ! function_exists( '_get_list_table' ) ) {
45
return array();
46
}
47
50
do_action( "cac/columns/default/storage_key={$this->key}" );
51
52
// get columns
53
+ $table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'comments' ) );
54
+ $columns = (array) $table->get_columns();
55
56
return $columns;
57
}
58
59
+ public function get_meta() {
60
+ global $wpdb;
61
+
62
return $wpdb->get_results( "SELECT DISTINCT meta_key FROM {$wpdb->commentmeta} ORDER BY 1", ARRAY_N );
63
+ }
64
65
public function manage_value( $column_name, $comment_id ) {
66
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
67
return false;
68
}
69
$value = $column->get_value( $comment_id );
70
71
// hook
74
75
echo $value;
76
}
77
+ }
classes/storage_model/link.php CHANGED
@@ -2,39 +2,24 @@
2
3
class CPAC_Storage_Model_Link extends CPAC_Storage_Model {
4
5
- /**
6
- * Constructor
7
- *
8
- * @since 2.0
9
- */
10
function __construct() {
11
12
- $this->key = 'wp-links';
13
- $this->label = __( 'Links' );
14
- $this->singular_label = __( 'Link' );
15
- $this->type = 'link';
16
- $this->page = 'link-manager';
17
- $this->menu_type = 'other';
18
19
- // headings
20
- add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 );
21
-
22
- // values
23
add_action( 'manage_link_custom_column', array( $this, 'manage_value' ), 100, 2 );
24
25
parent::__construct();
26
}
27
28
- /**
29
- * Get WP default supported admin columns per post type.
30
- *
31
- * @since 1.0
32
- *
33
- * @return array
34
- */
35
public function get_default_columns() {
36
37
- if ( ! function_exists('_get_list_table') ) {
38
return array();
39
}
40
@@ -43,38 +28,18 @@ class CPAC_Storage_Model_Link extends CPAC_Storage_Model {
43
do_action( "cac/columns/default/storage_key={$this->key}" );
44
45
// get columns
46
- $table = _get_list_table( 'WP_Links_List_Table', array( 'screen' => 'link-manager' ) );
47
- $columns = (array) $table->get_columns();
48
49
return $columns;
50
}
51
52
- /**
53
- * Get original columns
54
- *
55
- * @since 2.4.4
56
- */
57
public function get_default_column_names() {
58
return array();
59
}
60
61
- /**
62
- * Get Meta
63
- *
64
- * @since 2.0
65
- *
66
- * @return array
67
- */
68
- public function get_meta() {}
69
-
70
- /**
71
- * Manage value
72
- *
73
- * @since 2.0
74
- *
75
- * @param string $column_name
76
- * @param int $post_id
77
- */
78
public function manage_value( $column_name, $link_id ) {
79
80
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
2
3
class CPAC_Storage_Model_Link extends CPAC_Storage_Model {
4
5
function __construct() {
6
7
+ $this->key = 'wp-links';
8
+ $this->label = __( 'Links' );
9
+ $this->singular_label = __( 'Link' );
10
+ $this->type = 'link';
11
+ $this->page = 'link-manager';
12
+ $this->menu_type = 'other';
13
14
+ add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 );
15
add_action( 'manage_link_custom_column', array( $this, 'manage_value' ), 100, 2 );
16
17
parent::__construct();
18
}
19
20
public function get_default_columns() {
21
22
+ if ( ! function_exists( '_get_list_table' ) ) {
23
return array();
24
}
25
28
do_action( "cac/columns/default/storage_key={$this->key}" );
29
30
// get columns
31
+ $table = _get_list_table( 'WP_Links_List_Table', array( 'screen' => 'link-manager' ) );
32
+ $columns = (array) $table->get_columns();
33
34
return $columns;
35
}
36
37
public function get_default_column_names() {
38
return array();
39
}
40
41
+ public function get_meta() {}
42
+
43
public function manage_value( $column_name, $link_id ) {
44
45
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
classes/storage_model/media.php CHANGED
@@ -2,42 +2,26 @@
2
3
class CPAC_Storage_Model_Media extends CPAC_Storage_Model {
4
5
- /**
6
- * Constructor
7
- *
8
- * @since 2.0
9
- */
10
- function __construct() {
11
-
12
- $this->key = 'wp-media';
13
- $this->label = __( 'Media Library' );
14
- $this->singular_label = __( 'Media' );
15
- $this->type = 'media';
16
- $this->meta_type = 'post';
17
- $this->page = 'upload';
18
- $this->post_type = 'attachment';
19
- $this->menu_type = 'other';
20
-
21
- // headings
22
- // Increased the priority to overrule 3th party plugins such as Media Tags
23
- add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 );
24
-
25
- // values
26
add_action( 'manage_media_custom_column', array( $this, 'manage_value' ), 100, 2 );
27
28
parent::__construct();
29
}
30
31
- /**
32
- * Get WP default supported admin columns per post type.
33
- *
34
- * @since 1.0
35
- *
36
- * @return array
37
- */
38
public function get_default_columns() {
39
-
40
- if ( ! function_exists('_get_list_table') ) {
41
return array();
42
}
43
@@ -45,9 +29,8 @@ class CPAC_Storage_Model_Media extends CPAC_Storage_Model {
45
// See classes/third_party.php for an example.
46
do_action( "cac/columns/default/storage_key={$this->key}" );
47
48
- // get columns
49
- $table = _get_list_table ( 'WP_Media_List_Table', array( 'screen' => 'upload' ) );
50
- $columns = (array) $table->get_columns();
51
52
if ( $this->is_settings_page() ) {
53
$columns = array_merge( get_column_headers( 'upload' ), $columns );
@@ -56,48 +39,26 @@ class CPAC_Storage_Model_Media extends CPAC_Storage_Model {
56
return $columns;
57
}
58
59
- /**
60
- * Get original columns
61
- *
62
- * @since 2.4.4
63
- */
64
public function get_default_column_names() {
65
return array( 'cb', 'date', 'parent', 'icon', 'title', 'author', 'comments' );
66
}
67
68
- /**
69
- * Get Meta
70
- *
71
- * @since 2.0
72
- *
73
- * @return array
74
- */
75
- public function get_meta() {
76
- global $wpdb;
77
return $wpdb->get_results( "SELECT DISTINCT meta_key FROM {$wpdb->postmeta} pm JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE p.post_type = 'attachment' ORDER BY 1", ARRAY_N );
78
- }
79
-
80
- /**
81
- * Manage value
82
- *
83
- * @since 2.0
84
- *
85
- * @param string $column_name
86
- * @param int $post_id
87
- */
88
- public function manage_value( $column_name, $media_id ) {
89
90
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
91
return false;
92
}
93
-
94
$value = $column->get_value( $media_id );
95
96
- // add hook
97
$value = apply_filters( "cac/column/value", $value, $media_id, $column, $this->key );
98
$value = apply_filters( "cac/column/value/{$this->type}", $value, $media_id, $column, $this->key );
99
100
echo $value;
101
}
102
-
103
}
2
3
class CPAC_Storage_Model_Media extends CPAC_Storage_Model {
4
5
+ public function __construct() {
6
+
7
+ $this->key = 'wp-media';
8
+ $this->label = __( 'Media Library' );
9
+ $this->singular_label = __( 'Media' );
10
+ $this->type = 'media';
11
+ $this->meta_type = 'post';
12
+ $this->page = 'upload';
13
+ $this->post_type = 'attachment';
14
+ $this->menu_type = 'other';
15
+
16
+ // Increased the priority to overrule 3th party plugins such as Media Tags
17
+ add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 );
18
add_action( 'manage_media_custom_column', array( $this, 'manage_value' ), 100, 2 );
19
20
parent::__construct();
21
}
22
23
public function get_default_columns() {
24
+ if ( ! function_exists( '_get_list_table' ) ) {
25
return array();
26
}
27
29
// See classes/third_party.php for an example.
30
do_action( "cac/columns/default/storage_key={$this->key}" );
31
32
+ $table = _get_list_table( 'WP_Media_List_Table', array( 'screen' => 'upload' ) );
33
+ $columns = (array) $table->get_columns();
34
35
if ( $this->is_settings_page() ) {
36
$columns = array_merge( get_column_headers( 'upload' ), $columns );
39
return $columns;
40
}
41
42
public function get_default_column_names() {
43
return array( 'cb', 'date', 'parent', 'icon', 'title', 'author', 'comments' );
44
}
45
46
+ public function get_meta() {
47
+ global $wpdb;
48
+
49
return $wpdb->get_results( "SELECT DISTINCT meta_key FROM {$wpdb->postmeta} pm JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE p.post_type = 'attachment' ORDER BY 1", ARRAY_N );
50
+ }
51
52
+ public function manage_value( $column_name, $media_id ) {
53
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
54
return false;
55
}
56
$value = $column->get_value( $media_id );
57
58
+ // hooks
59
$value = apply_filters( "cac/column/value", $value, $media_id, $column, $this->key );
60
$value = apply_filters( "cac/column/value/{$this->type}", $value, $media_id, $column, $this->key );
61
62
echo $value;
63
}
64
}
classes/storage_model/post.php CHANGED
@@ -7,21 +7,19 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
7
private $post_type_object;
8
9
/**
10
- * Constructor
11
- *
12
* @since 2.0
13
*/
14
- function __construct( $post_type ) {
15
16
$this->set_post_type( $post_type );
17
18
- $this->key = $this->post_type;
19
- $this->label = $this->post_type_object->labels->name;
20
- $this->singular_label = $this->post_type_object->labels->singular_name;
21
- $this->type = 'post';
22
- $this->meta_type = 'post';
23
- $this->page = 'edit';
24
- $this->menu_type = 'post';
25
26
// Headings
27
@@ -32,57 +30,42 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
32
// Priority set to 100 top make sure the WooCommerce headings are overwritten by CAC
33
// Filter is located in get_column_headers().
34
// @todo_minor check compatibility issues for this deprecated filter
35
- add_filter( "manage_{$this->page}-{$post_type}_columns", array( $this, 'add_headings' ), 100 );
36
37
// values
38
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value_callback' ), 100, 2 );
39
40
- // @todo: description
41
add_action( 'load-edit.php', array( $this, 'set_columns_on_current_screen' ), 1000 );
42
43
parent::__construct();
44
}
45
46
/**
47
- * Set posttype
48
- *
49
* @since 2.3.5
50
*/
51
public function get_post_type() {
52
-
53
return $this->post_type;
54
}
55
56
/**
57
- * Get post ID's
58
- *
59
* @since 2.4.7
60
- *
61
- * @param array $args
62
- * @return array Posts
63
*/
64
public function get_posts( $args = array() ) {
65
- $defaults = array(
66
- 'numberposts' => -1,
67
- 'post_status' => array( 'any', 'trash' ),
68
- 'post_type' => $this->post_type,
69
- 'fields' => 'ids',
70
'no_found_rows' => 1, // lowers our carbon footprint
71
);
72
-
73
- $post_ids = (array) get_posts( array_merge( $defaults, $args ) );
74
-
75
- return $post_ids;
76
}
77
78
/**
79
- * Set posttype
80
- *
81
* @since 2.3.5
82
*/
83
private function set_post_type( $post_type ) {
84
-
85
- $this->post_type = $post_type;
86
$this->post_type_object = get_post_type_object( $post_type );
87
}
88
@@ -95,19 +78,17 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
95
96
// Setup post data for current post
97
$post_old = $post;
98
- $post = get_post( $id );
99
setup_postdata( $post );
100
101
// Remove Admin Columns action for this column's value
102
remove_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value_callback' ), 100, 2 );
103
104
ob_start();
105
-
106
// Run WordPress native actions to display column content
107
if ( is_post_type_hierarchical( $this->post_type ) ) {
108
do_action( 'manage_pages_custom_column', $column, $id );
109
- }
110
- else {
111
do_action( 'manage_posts_custom_column', $column, $id );
112
}
113
@@ -129,8 +110,6 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
129
}
130
131
/**
132
- * Get original columns
133
- *
134
* @since 2.4.4
135
*/
136
public function get_default_column_names() {
@@ -157,21 +136,14 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
157
}
158
159
/**
160
- * Get screen link
161
- *
162
* @since 2.0
163
- *
164
- * @return string Link
165
*/
166
protected function get_screen_link() {
167
-
168
return add_query_arg( array( 'post_type' => $this->key ), admin_url( $this->page . '.php' ) );
169
}
170
171
/**
172
* @since 2.2
173
- *
174
- * @return bool
175
*/
176
public function is_columns_screen() {
177
@@ -196,7 +168,7 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
196
*/
197
public function get_default_columns() {
198
199
- if ( ! function_exists('_get_list_table') ) {
200
return array();
201
}
202
@@ -218,24 +190,16 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
218
}
219
220
/**
221
- * Get Meta
222
- *
223
* @since 2.0
224
- *
225
- * @return array
226
- */
227
- public function get_meta() {
228
- global $wpdb;
229
- return $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT meta_key FROM {$wpdb->postmeta} pm JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE p.post_type = %s ORDER BY 1", $this->key ), ARRAY_N );
230
- }
231
232
/**
233
- * Manage value
234
- *
235
* @since 2.0
236
- *
237
- * @param string $column_name
238
- * @param int $post_id
239
*/
240
public function manage_value( $column_name, $post_id ) {
241
@@ -247,7 +211,7 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
247
248
// Setup post data for current post
249
$post_old = $post;
250
- $post = get_post( $post_id );
251
setup_postdata( $post );
252
253
$value = $column->get_value( $post_id );
@@ -255,7 +219,6 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
255
$value = apply_filters( "cac/column/value", $value, $post_id, $column, $this->key );
256
$value = apply_filters( "cac/column/value/{$this->type}", $value, $post_id, $column, $this->key );
257
258
-
259
// Reset query to old post
260
$post = $post_old;
261
@@ -267,22 +230,17 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
267
}
268
269
/**
270
- * Manage value callback
271
- *
272
- * @since ?
273
*/
274
public function manage_value_callback( $column_name, $post_id ) {
275
276
$column = $this->get_column_by_name( $column_name );
277
-
278
if ( $column && ! empty( $column->properties->handle ) ) {
279
ob_start();
280
$this->manage_value( $column_name, $post_id );
281
ob_end_clean();
282
- }
283
- else {
284
$this->manage_value( $column_name, $post_id );
285
}
286
}
287
-
288
}
7
private $post_type_object;
8
9
/**
10
* @since 2.0
11
*/
12
+ public function __construct( $post_type ) {
13
14
$this->set_post_type( $post_type );
15
16
+ $this->key = $this->post_type;
17
+ $this->label = $this->post_type_object->labels->name;
18
+ $this->singular_label = $this->post_type_object->labels->singular_name;
19
+ $this->type = 'post';
20
+ $this->meta_type = 'post';
21
+ $this->page = 'edit';
22
+ $this->menu_type = 'post';
23
24
// Headings
25
30
// Priority set to 100 top make sure the WooCommerce headings are overwritten by CAC
31
// Filter is located in get_column_headers().
32
// @todo_minor check compatibility issues for this deprecated filter
33
+ add_filter( "manage_{$this->page}-{$post_type}_columns", array( $this, 'add_headings' ), 100 );
34
35
// values
36
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value_callback' ), 100, 2 );
37
38
add_action( 'load-edit.php', array( $this, 'set_columns_on_current_screen' ), 1000 );
39
40
parent::__construct();
41
}
42
43
/**
44
* @since 2.3.5
45
*/
46
public function get_post_type() {
47
return $this->post_type;
48
}
49
50
/**
51
* @since 2.4.7
52
*/
53
public function get_posts( $args = array() ) {
54
+ $defaults = array(
55
+ 'numberposts' => - 1,
56
+ 'post_status' => array( 'any', 'trash' ),
57
+ 'post_type' => $this->post_type,
58
+ 'fields' => 'ids',
59
'no_found_rows' => 1, // lowers our carbon footprint
60
);
61
+ return (array) get_posts( array_merge( $defaults, $args ) );
62
}
63
64
/**
65
* @since 2.3.5
66
*/
67
private function set_post_type( $post_type ) {
68
+ $this->post_type = $post_type;
69
$this->post_type_object = get_post_type_object( $post_type );
70
}
71
78
79
// Setup post data for current post
80
$post_old = $post;
81
+ $post = get_post( $id );
82
setup_postdata( $post );
83
84
// Remove Admin Columns action for this column's value
85
remove_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value_callback' ), 100, 2 );
86
87
ob_start();
88
// Run WordPress native actions to display column content
89
if ( is_post_type_hierarchical( $this->post_type ) ) {
90
do_action( 'manage_pages_custom_column', $column, $id );
91
+ } else {
92
do_action( 'manage_posts_custom_column', $column, $id );
93
}
94
110
}
111
112
/**
113
* @since 2.4.4
114
*/
115
public function get_default_column_names() {
136
}
137
138
/**
139
* @since 2.0
140
*/
141
protected function get_screen_link() {
142
return add_query_arg( array( 'post_type' => $this->key ), admin_url( $this->page . '.php' ) );
143
}
144
145
/**
146
* @since 2.2
147
*/
148
public function is_columns_screen() {
149
168
*/
169
public function get_default_columns() {
170
171
+ if ( ! function_exists( '_get_list_table' ) ) {
172
return array();
173
}
174
190
}
191
192
/**
193
* @since 2.0
194
+ */
195
+ public function get_meta() {
196
+ global $wpdb;
197
+
198
+ return $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT meta_key FROM {$wpdb->postmeta} pm JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE p.post_type = %s ORDER BY 1", $this->key ), ARRAY_N );
199
+ }
200
201
/**
202
* @since 2.0
203
*/
204
public function manage_value( $column_name, $post_id ) {
205
211
212
// Setup post data for current post
213
$post_old = $post;
214
+ $post = get_post( $post_id );
215
setup_postdata( $post );
216
217
$value = $column->get_value( $post_id );
219
$value = apply_filters( "cac/column/value", $value, $post_id, $column, $this->key );
220
$value = apply_filters( "cac/column/value/{$this->type}", $value, $post_id, $column, $this->key );
221
222
// Reset query to old post
223
$post = $post_old;
224
230
}
231
232
/**
233
+ * @since 2.4.7
234
*/
235
public function manage_value_callback( $column_name, $post_id ) {
236
237
$column = $this->get_column_by_name( $column_name );
238
if ( $column && ! empty( $column->properties->handle ) ) {
239
ob_start();
240
$this->manage_value( $column_name, $post_id );
241
ob_end_clean();
242
+ } else {
243
$this->manage_value( $column_name, $post_id );
244
}
245
}
246
}
classes/storage_model/user.php CHANGED
@@ -3,24 +3,19 @@
3
class CPAC_Storage_Model_User extends CPAC_Storage_Model {
4
5
/**
6
- * Constructor
7
- *
8
* @since 2.0
9
*/
10
- function __construct() {
11
12
- $this->key = 'wp-users';
13
- $this->label = __( 'Users' );
14
- $this->singular_label = __( 'User' );
15
- $this->type = 'user';
16
- $this->meta_type = 'user';
17
- $this->page = 'users';
18
- $this->menu_type = 'other';
19
20
- // headings
21
- add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 );
22
-
23
- // values
24
add_filter( 'manage_users_custom_column', array( $this, 'manage_value_callback' ), 100, 3 );
25
26
parent::__construct();
@@ -33,30 +28,20 @@ class CPAC_Storage_Model_User extends CPAC_Storage_Model {
33
34
// Remove Admin Columns action for this column's value
35
remove_action( "manage_users_custom_column", array( $this, 'manage_value_callback' ), 100, 3 );
36
-
37
ob_start();
38
-
39
do_action( "manage_users_custom_column", $column, $id );
40
-
41
$contents = ob_get_clean();
42
-
43
- // Add removed Admin Columns action for this column's value
44
add_action( "manage_users_custom_column", array( $this, 'manage_value_callback' ), 100, 3 );
45
46
return $contents;
47
}
48
49
/**
50
- * Get WP default supported admin columns per post type.
51
- *
52
* @see CPAC_Type::get_default_columns()
53
- * @since 1.0
54
- *
55
- * @return array
56
*/
57
public function get_default_columns() {
58
59
- if ( ! function_exists('_get_list_table') ) {
60
return array();
61
}
62
@@ -64,8 +49,8 @@ class CPAC_Storage_Model_User extends CPAC_Storage_Model {
64
do_action( "cac/columns/default/storage_key={$this->key}" );
65
66
// get columns
67
- $table = _get_list_table( 'WP_Users_List_Table', array( 'screen' => 'users' ) );
68
- $columns = (array) $table->get_columns();
69
70
if ( $this->is_settings_page() ) {
71
$columns = array_merge( get_column_headers( 'users' ), $columns );
@@ -75,8 +60,6 @@ class CPAC_Storage_Model_User extends CPAC_Storage_Model {
75
}
76
77
/**
78
- * Get original columns
79
- *
80
* @since 2.4.4
81
*/
82
public function get_default_column_names() {
@@ -84,21 +67,12 @@ class CPAC_Storage_Model_User extends CPAC_Storage_Model {
84
}
85
86
/**
87
- * Manage value
88
- *
89
* @since 2.0.2
90
- *
91
- * @param string $column_name
92
- * @param int $user_id
93
- * @param string $value
94
*/
95
public function manage_value( $column_name, $user_id, $value = '' ) {
96
-
97
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
98
return $value;
99
}
100
-
101
- // get value
102
$custom_value = $column->get_value( $user_id );
103
104
// make sure it absolutely empty and check for (string) 0
@@ -113,30 +87,13 @@ class CPAC_Storage_Model_User extends CPAC_Storage_Model {
113
return $value;
114
}
115
116
- /**
117
- * Callback Manage value
118
- *
119
- * @since 2.0.2
120
- *
121
- * @param string $value
122
- * @param string $column_name
123
- * @param int $user_id
124
- */
125
public function manage_value_callback( $value, $column_name, $user_id ) {
126
-
127
return $this->manage_value( $column_name, $user_id, $value );
128
}
129
130
- /**
131
- * Get Meta
132
- *
133
- * @see CPAC_Columns::get_meta_keys()
134
- * @since 2.0
135
- *
136
- * @return array
137
- */
138
- public function get_meta() {
139
- global $wpdb;
140
- return $wpdb->get_results( "SELECT DISTINCT meta_key FROM {$wpdb->usermeta} ORDER BY 1", ARRAY_N );
141
- }
142
}
3
class CPAC_Storage_Model_User extends CPAC_Storage_Model {
4
5
/**
6
* @since 2.0
7
*/
8
+ public function __construct() {
9
10
+ $this->key = 'wp-users';
11
+ $this->label = __( 'Users' );
12
+ $this->singular_label = __( 'User' );
13
+ $this->type = 'user';
14
+ $this->meta_type = 'user';
15
+ $this->page = 'users';
16
+ $this->menu_type = 'other';
17
18
+ add_filter( "manage_{$this->page}_columns", array( $this, 'add_headings' ), 100 );
19
add_filter( 'manage_users_custom_column', array( $this, 'manage_value_callback' ), 100, 3 );
20
21
parent::__construct();
28
29
// Remove Admin Columns action for this column's value
30
remove_action( "manage_users_custom_column", array( $this, 'manage_value_callback' ), 100, 3 );
31
ob_start();
32
do_action( "manage_users_custom_column", $column, $id );
33
$contents = ob_get_clean();
34
add_action( "manage_users_custom_column", array( $this, 'manage_value_callback' ), 100, 3 );
35
36
return $contents;
37
}
38
39
/**
40
* @see CPAC_Type::get_default_columns()
41
*/
42
public function get_default_columns() {
43
44
+ if ( ! function_exists( '_get_list_table' ) ) {
45
return array();
46
}
47
49
do_action( "cac/columns/default/storage_key={$this->key}" );
50
51
// get columns
52
+ $table = _get_list_table( 'WP_Users_List_Table', array( 'screen' => 'users' ) );
53
+ $columns = (array) $table->get_columns();
54
55
if ( $this->is_settings_page() ) {
56
$columns = array_merge( get_column_headers( 'users' ), $columns );
60
}
61
62
/**
63
* @since 2.4.4
64
*/
65
public function get_default_column_names() {
67
}
68
69
/**
70
* @since 2.0.2
71
*/
72
public function manage_value( $column_name, $user_id, $value = '' ) {
73
if ( ! ( $column = $this->get_column_by_name( $column_name ) ) ) {
74
return $value;
75
}
76
$custom_value = $column->get_value( $user_id );
77
78
// make sure it absolutely empty and check for (string) 0
87
return $value;
88
}
89
90
public function manage_value_callback( $value, $column_name, $user_id ) {
91
return $this->manage_value( $column_name, $user_id, $value );
92
}
93
94
+ public function get_meta() {
95
+ global $wpdb;
96
+
97
+ return $wpdb->get_results( "SELECT DISTINCT meta_key FROM {$wpdb->usermeta} ORDER BY 1", ARRAY_N );
98
+ }
99
}
classes/third_party/yoast_seo.php CHANGED
@@ -1,5 +1,4 @@
1
<?php
2
-
3
/**
4
* Fix for getting the columns loaded by WordPress SEO Yoast
5
*
@@ -10,30 +9,32 @@
10
* @since 1.4.6
11
*/
12
function cpac_pre_load_wordpress_seo_class_metabox() {
13
-
14
- if ( ! defined('WPSEO_PATH') || ! file_exists( WPSEO_PATH . 'admin/class-metabox.php' ) ) {
15
return;
16
}
17
18
- global $pagenow;
19
20
- // page is a CPAC page or CPAC ajax event
21
- if (
22
- ( isset( $_GET['page'] ) && 'codepress-admin-columns' == $_GET['page'] && 'options-general.php' == $pagenow )
23
- ||
24
- // for when column list is populated through ajax
25
- ( defined('DOING_AJAX') && DOING_AJAX &&
26
- ( ! empty( $_POST['type'] )
27
- ||
28
- ( ! empty( $_POST['plugin_id'] ) && 'cpac' === $_POST['plugin_id'] ) )
29
- )
30
- ) {
31
32
- require_once WPSEO_PATH . 'admin/class-metabox.php';
33
- if ( class_exists( 'WPSEO_Metabox', false ) ) {
34
new WPSEO_Metabox;
35
}
36
}
37
-
38
}
39
add_action( 'plugins_loaded', 'cpac_pre_load_wordpress_seo_class_metabox', 0 );
1
<?php
2
/**
3
* Fix for getting the columns loaded by WordPress SEO Yoast
4
*
9
* @since 1.4.6
10
*/
11
function cpac_pre_load_wordpress_seo_class_metabox() {
12
+ if ( ! defined( 'WPSEO_PATH' ) ) {
13
return;
14
}
15
16
+ if ( ! cac_is_doing_ajax() && ! cac_is_setting_screen() ) {
17
+ return;
18
+ }
19
20
+ // Yoast SEO version > 3.0
21
+ if ( file_exists( WPSEO_PATH . 'admin/class-meta-columns.php' ) ) {
22
+ require_once WPSEO_PATH . 'admin/class-meta-columns.php';
23
+ if ( class_exists( 'WPSEO_Meta_Columns', false ) ) {
24
+ $metabox = new WPSEO_Meta_Columns;
25
+ if ( method_exists( $metabox, 'setup_hooks' ) ) {
26
+ $metabox->setup_hooks();
27
+ }
28
+ }
29
+ }
30
31
+ // Yoast SEO version < 3.0
32
+ if ( file_exists( WPSEO_PATH . 'admin/class-meta-box.php' ) ) {
33
+ require_once WPSEO_PATH . 'admin/class-meta-box.php';
34
+ if ( class_exists( 'WPSEO_Meta_Columns', false ) ) {
35
new WPSEO_Metabox;
36
}
37
}
38
}
39
+
40
add_action( 'plugins_loaded', 'cpac_pre_load_wordpress_seo_class_metabox', 0 );
classes/utility.php CHANGED
@@ -79,4 +79,25 @@ function cpac_is_woocommerce_active() {
79
80
function cpac_is_pro_active() {
81
return class_exists( 'CAC_Addon_Pro', false );
82
}
79
80
function cpac_is_pro_active() {
81
return class_exists( 'CAC_Addon_Pro', false );
82
+ }
83
+
84
+ /**
85
+ * Whether the current screen is the Admin Columns settings screen
86
+ *
87
+ * @since 2.4.8
88
+ * @param strong $tab Specifies a tab screen (optional)
89
+ * @return bool True if the current screen is the settings screen, false otherwise
90
+ */
91
+ function cac_is_setting_screen( $tab = '' ){
92
+ global $pagenow;
93
+
94
+ if ( ! ( 'options-general.php' === $pagenow && isset( $_GET['page'] ) && ( 'codepress-admin-columns' === $_GET['page'] ) ) ) {
95
+ return false;
96
+ }
97
+
98
+ if ( $tab && ( empty( $_GET['tab'] ) || ( isset( $_GET['tab'] ) && $tab !== $_GET['tab'] ) ) ) {
99
+ return false;
100
+ }
101
+
102
+ return true;
103
}
codepress-admin-columns.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/*
3
Plugin Name: Admin Columns
4
- Version: 2.4.7
5
Description: Customize columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
6
Author: AdminColumns.com
7
Author URI: http://www.admincolumns.com
@@ -32,7 +32,7 @@ if ( ! defined( 'ABSPATH' ) ) {
32
}
33
34
// Plugin information
35
- define( 'CPAC_VERSION', '2.4.7' ); // Current plugin version
36
define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
37
define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
38
define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
@@ -507,17 +507,7 @@ class CPAC {
507
*/
508
public function is_settings_screen( $tab = '' ) {
509
510
- global $pagenow;
511
-
512
- if ( ! ( 'options-general.php' === $pagenow && isset( $_GET['page'] ) && ( 'codepress-admin-columns' === $_GET['page'] ) ) ) {
513
- return false;
514
- }
515
-
516
- if ( $tab && ( empty( $_GET['tab'] ) || ( isset( $_GET['tab'] ) && $tab !== $_GET['tab'] ) ) ) {
517
- return false;
518
- }
519
-
520
- return true;
521
}
522
523
/**
1
<?php
2
/*
3
Plugin Name: Admin Columns
4
+ Version: 2.4.8
5
Description: Customize columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
6
Author: AdminColumns.com
7
Author URI: http://www.admincolumns.com
32
}
33
34
// Plugin information
35
+ define( 'CPAC_VERSION', '2.4.8' ); // Current plugin version
36
define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // Latest version which requires an upgrade
37
define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
38
define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
507
*/
508
public function is_settings_screen( $tab = '' ) {
509
510
+ return cac_is_setting_screen( $tab );
511
}
512
513
/**
languages/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # Translate into your own language
2
+
3
+ Admin Columns can be easily translated into your chosen language. If you don’t have a lot of time, no problem. You can just translate sentences collaborative at Transifex.
4
+
5
+ 1. **Go to [Trasifex - Admin Columns](https://www.transifex.com/codepress/admin-columns/)**
6
+ 2. If you do not have an account yet you can register one for free.
7
+ 3. Pick your language and start translating.
8
+
languages/codepress-admin-columns-ar.mo CHANGED
Binary file
languages/codepress-admin-columns-ar.po DELETED
@@ -1,1267 +0,0 @@
1
- # Copyright (C) 2015 Codepress Admin Columns
2
- # This file is distributed under the same license as the Codepress Admin Columns package.
3
- # Translators:
4
- # Hassan, 2013
5
- # Hassan, 2013
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: Admin Columns\n"
9
- "Report-Msgid-Bugs-To: https://www.admincolumns.com\n"
10
- "PO-Revision-Date: 2015-10-12 15:26+0200\n"
11
- "Last-Translator: Codepress <info@codepress.nl>\n"
12
- "Language-Team: Arabic (http://www.transifex.com/codepress/admin-columns/language/ar/)\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
- "Language: ar\n"
17
- "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
18
- "X-Poedit-Basepath: ..\n"
19
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;"
20
- "__ngettext_noop:1,2\n"
21
- "X-Poedit-SourceCharset: UTF-8\n"
22
- "POT-Creation-Date: \n"
23
- "X-Generator: Poedit 1.8.5\n"
24
- "X-Poedit-SearchPath-0: .\n"
25
- "X-Poedit-SearchPathExcluded-0: *.js\n"
26
-
27
- #: ../codepress-admin-columns.php:451
28
- msgid "Edit columns"
29
- msgstr "تحرير الأعمدة"
30
-
31
- #: ../classes/addons.php:110
32
- msgid "Plugins"
33
- msgstr ""
34
-
35
- #: ../classes/addons.php:135
36
- msgid "Advanced Custom Fields"
37
- msgstr ""
38
-
39
- #: ../classes/addons.php:136
40
- msgid "Display and edit Advanced Custom Fields fields in the posts overview in seconds!"
41
- msgstr ""
42
-
43