Admin Columns - Version 2.2.5

Version Description

  • [Fixed] Error with actions icons.
  • [Added] New Column! Used-by-menu column; will display in which menu a post/page/taxonomy is being used. With support for column sorting in posts.
  • [Fixed] Only ajax calls from cpac will trigger the loading of storage_models now.
Download this release

Release Info

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

Code changes from version 2.2.4 to 2.2.5

Files changed (105) hide show
  1. README.md +0 -0
  2. assets/images/addon_sortable_1.png +0 -0
  3. assets/images/arrows.png +0 -0
  4. assets/images/checkbox.png +0 -0
  5. assets/images/checkmark.png +0 -0
  6. assets/images/checkmark_single.png +0 -0
  7. assets/images/comment_edit.png +0 -0
  8. assets/images/cross.png +0 -0
  9. assets/images/facebook.png +0 -0
  10. assets/images/icon.png +0 -0
  11. assets/images/import_export.png +0 -0
  12. assets/images/information.png +0 -0
  13. assets/images/loading.gif +0 -0
  14. assets/images/no.png +0 -0
  15. assets/images/settings.png +0 -0
  16. assets/images/sort.png +0 -0
  17. assets/images/square.png +0 -0
  18. assets/images/trash.png +0 -0
  19. assets/images/twitter.png +0 -0
  20. assets/js/admin-columns.js +1 -1
  21. assets/js/admin-settings.js +2 -1
  22. assets/js/admin-settings.min.js +1 -1
  23. classes/column.php +4 -7
  24. classes/column/acf-placeholder.php +1 -1
  25. classes/column/comment/ID.php +1 -1
  26. classes/column/comment/actions.php +1 -1
  27. classes/column/comment/agent.php +1 -1
  28. classes/column/comment/approved.php +1 -1
  29. classes/column/comment/author-avatar.php +1 -1
  30. classes/column/comment/author-email.php +1 -1
  31. classes/column/comment/author-ip.php +1 -1
  32. classes/column/comment/author-url.php +1 -1
  33. classes/column/comment/author.php +1 -1
  34. classes/column/comment/date-gmt.php +1 -1
  35. classes/column/comment/date.php +1 -1
  36. classes/column/comment/excerpt.php +1 -1
  37. classes/column/comment/reply-to.php +1 -1
  38. classes/column/comment/word-count.php +1 -1
  39. classes/column/custom-field.php +1 -1
  40. classes/column/default.php +4 -4
  41. classes/column/link/ID.php +1 -1
  42. classes/column/link/actions.php +2 -2
  43. classes/column/link/description.php +1 -1
  44. classes/column/link/image.php +1 -1
  45. classes/column/link/length.php +1 -1
  46. classes/column/link/notes.php +1 -1
  47. classes/column/link/owner.php +1 -1
  48. classes/column/link/rss.php +1 -1
  49. classes/column/link/target.php +1 -1
  50. classes/column/media/ID.php +1 -1
  51. classes/column/media/actions.php +1 -1
  52. classes/column/media/alternate-text.php +1 -1
  53. classes/column/media/available-sizes.php +1 -1
  54. classes/column/media/caption.php +1 -1
  55. classes/column/media/description.php +1 -1
  56. classes/column/media/dimensions.php +1 -1
  57. classes/column/media/exif-data.php +1 -1
  58. classes/column/media/file-name.php +1 -1
  59. classes/column/media/file-size.php +1 -1
  60. classes/column/media/full-path.php +1 -1
  61. classes/column/media/height.php +1 -1
  62. classes/column/media/mime-type.php +1 -1
  63. classes/column/media/width.php +1 -1
  64. classes/column/post/ID.php +1 -1
  65. classes/column/post/actions.php +83 -7
  66. classes/column/post/attachment-count.php +1 -1
  67. classes/column/post/attachment.php +1 -1
  68. classes/column/post/author-name.php +1 -1
  69. classes/column/post/before-moretag.php +1 -1
  70. classes/column/post/comment-count.php +1 -1
  71. classes/column/post/comment-status.php +1 -2
  72. classes/column/post/excerpt.php +1 -1
  73. classes/column/post/featured-image.php +1 -1
  74. classes/column/post/formats.php +7 -4
  75. classes/column/post/modified.php +1 -1
  76. classes/column/post/order.php +1 -1
  77. classes/column/post/page-template.php +1 -1
  78. classes/column/post/parent.php +1 -1
  79. classes/column/post/permalink.php +1 -2
  80. classes/column/post/ping-status.php +1 -1
  81. classes/column/post/roles.php +1 -1
  82. classes/column/post/slug.php +1 -1
  83. classes/column/post/status.php +1 -1
  84. classes/column/post/sticky.php +1 -1
  85. classes/column/post/title-raw.php +39 -0
  86. classes/column/post/word-count.php +1 -1
  87. classes/column/taxonomy.php +2 -2
  88. classes/column/used-by-menu.php +146 -0
  89. classes/column/user/ID.php +1 -1
  90. classes/column/user/actions.php +1 -1
  91. classes/column/user/comment-count.php +1 -1
  92. classes/column/user/description.php +1 -1
  93. classes/column/user/first-name.php +1 -1
  94. classes/column/user/last-name.php +1 -1
  95. classes/column/user/nickname.php +1 -1
  96. classes/column/user/post-count.php +1 -1
  97. classes/column/user/registered.php +1 -1
  98. classes/column/user/url.php +1 -1
  99. classes/settings.php +4 -1
  100. classes/storage_model.php +21 -9
  101. classes/storage_model/post.php +1 -0
  102. codepress-admin-columns.php +19 -23
  103. external/floatthead/jquery.floatThead.js +757 -0
  104. languages/cpac-fr_FR.po +91 -102
  105. readme.txt +6 -1
README.md ADDED
File without changes
assets/images/addon_sortable_1.png CHANGED
File without changes
assets/images/arrows.png CHANGED
File without changes
assets/images/checkbox.png CHANGED
File without changes
assets/images/checkmark.png CHANGED
File without changes
assets/images/checkmark_single.png CHANGED
File without changes
assets/images/comment_edit.png CHANGED
File without changes
assets/images/cross.png CHANGED
File without changes
assets/images/facebook.png CHANGED
File without changes
assets/images/icon.png CHANGED
File without changes
assets/images/import_export.png CHANGED
File without changes
assets/images/information.png CHANGED
File without changes
assets/images/loading.gif CHANGED
File without changes
assets/images/no.png CHANGED
File without changes
assets/images/settings.png CHANGED
File without changes
assets/images/sort.png CHANGED
File without changes
assets/images/square.png CHANGED
File without changes
assets/images/trash.png CHANGED
File without changes
assets/images/twitter.png CHANGED
File without changes
assets/js/admin-columns.js CHANGED
@@ -1,6 +1,6 @@
1
jQuery( document ).ready( function( $ ) {
2
cpac_tooltips();
3
-
4
if ( typeof CPAC.storage_model !== 'undefined' && CPAC.storage_model.is_table_header_fixed ) {
5
cpac_floatingheader();
6
}
1
jQuery( document ).ready( function( $ ) {
2
cpac_tooltips();
3
+
4
if ( typeof CPAC.storage_model !== 'undefined' && CPAC.storage_model.is_table_header_fixed ) {
5
cpac_floatingheader();
6
}
assets/js/admin-settings.js CHANGED
@@ -111,11 +111,12 @@ jQuery.fn.cpac_column_refresh = function() {
111
112
// Fetch new form HTML
113
jQuery.post( ajaxurl, {
114
action: 'cpac_column_refresh',
115
column: jQuery( this ).find( 'input.column-name' ).val(),
116
formdata: jQuery( this ).parents( 'form' ).serialize()
117
}, function( data ) {
118
- console.log(data);
119
// Replace current form by new form
120
var newel = jQuery( '<div>' + data + '</div>' ).children();
121
el.replaceWith( newel );
111
112
// Fetch new form HTML
113
jQuery.post( ajaxurl, {
114
+ plugin_id: 'cpac',
115
action: 'cpac_column_refresh',
116
column: jQuery( this ).find( 'input.column-name' ).val(),
117
formdata: jQuery( this ).parents( 'form' ).serialize()
118
}, function( data ) {
119
+
120
// Replace current form by new form
121
var newel = jQuery( '<div>' + data + '</div>' ).children();
122
el.replaceWith( newel );
assets/js/admin-settings.min.js CHANGED
@@ -1,4 +1,4 @@
1
/*
2
* Fires when the dom is ready
3
*
4
- */function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_addons(){}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_add_column(){jQuery("#cpac .add_column").click(function(e){var t=jQuery(this).closest(".columns-container"),n=jQuery(".for-cloning-only .cpac-column",t).first().clone(),r=t.attr("data-type");if(n.length>0){n.cpac_update_clone_id(r);jQuery(".cpac-columns form",t).append(n);n.column_bind_toggle();n.column_bind_remove();n.column_bind_events();n.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:n.offset().top-58},300)});cpac_sortable();jQuery(document).trigger("column_add",n)}e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var t=e(".sidebox#direct-feedback");t.find("#feedback-choice a.no").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.find("#feedback-support").slideDown()});t.find("#feedback-choice a.yes").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.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 t=jQuery("#contextual-help-wrap");t.parent().show();jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',t).trigger("click");t.slideDown("fast",function(){t.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),t=e.attr("rel"),n=e.attr("data-pos"),r={at:"left top",my:"right top",edge:"right",offset:"0 0"};"right"==n&&(r={at:"right middle",my:"left middle",edge:"left"});e.pointer({content:jQuery("#"+t).html(),position:r,pointerWidth:250,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+r.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,t){var n=jQuery(this).attr("href");if(n){var r=n.replace("#cpac-box-","");jQuery(".cpac-menu a").removeClass("current");jQuery(".columns-container").hide();jQuery(this).addClass("current");var i=jQuery('.columns-container[data-type="'+r+'"]').show(),s=i.find(".cpac-columns");jQuery(document).trigger("cac_menu_change",s)}e.preventDefault()});e.find("a.current").trigger("click")}jQuery(document).ready(function(){if(jQuery("#cpac").length===0)return!1;cpac_pointer();cpac_submit_form();cpac_clear_input_defaults();cpac_sortable();cpac_menu();cpac_help();cpac_add_column();cpac_addons();cpac_importexport();cpac_sidebar_feedback();jQuery(".cpac-column").each(function(e,t){jQuery(t).column_bind_toggle();jQuery(t).column_bind_remove();jQuery(t).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(t){t.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.cpac_column_refresh=function(){var e=jQuery(this);e.addClass("loading");e.find(".column-form").prepend('<span class="spinner" />');jQuery.post(ajaxurl,{action:"cpac_column_refresh",column:jQuery(this).find("input.column-name").val(),formdata:jQuery(this).parents("form").serialize()},function(t){console.log(t);var n=jQuery("<div>"+t+"</div>").children();e.replaceWith(n);e=n;e.column_bind_toggle();e.column_bind_remove();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),t=e.closest(".columns-container "),n=t.attr("data-type"),r=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var i=jQuery("optgroup",this).children(":selected"),s=i.val(),o=i.text(),u=jQuery(this).next(".msg").hide(),a=t.find('.for-cloning-only .cpac-column[data-type="'+s+'"]');if(a.length)if(a.find(".is-disabled").length){u.html(a.find(".is-disabled").html()).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected")}else{if(typeof a.attr("data-clone")=="undefined"&&jQuery(".cpac-columns",t).find('[data-type="'+s+'"]').length){u.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected");return}var f=a.clone();f.addClass("opened").find(".column-form").show();f.find(".column-meta").replaceWith(e.find(".column-meta"));f.find(".column-form").replaceWith(e.find(".column-form"));f.cpac_update_clone_id(n);e.replaceWith(f);f.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.find(".input-width-range").each(function(){var e=jQuery(this).closest("td").find(".input-width"),t=jQuery(this).closest("td").find(".width-decription"),n=jQuery(e)[0].defaultValue,r=t.attr("title");jQuery(this).slider({range:"min",min:0,max:100,value:n,slide:function(n,i){var s=i.value>0?i.value+"%":r;jQuery(e).val(i.value);jQuery(t).text(s)}})});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");if(jQuery(this).hasClass("image-size-custom")){jQuery(".custom-size-w",e).removeClass("hidden");jQuery(".custom-size-h",e).removeClass("hidden")}else{jQuery(".custom-size-w",e).addClass("hidden");jQuery(".custom-size-h",e).addClass("hidden")}});e.find(".column-form .label label").hover(function(){jQuery(this).find("p.description").show()},function(){jQuery(this).find("p.description").hide()});e.find(".column_type select").val()=="column-meta"&&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.cpac_update_clone_id=function(e){var t=jQuery(this),n=t.attr("data-type"),r=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),i=jQuery(r).find('*[data-type="'+n+'"]').not(t),s=jQuery.map(i,function(e,t){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});s.sort();var o=Math.max.apply(null,s)+1;for(var u=0;u<=o;u++)if(-1===jQuery.inArray(u,s))break;if(0===u)return;t.attr("data-clone",u);t.find("input.clone").val(u);t.find("input.column-name").val(n+"-"+u);var a=t.find("input, select, label");jQuery(a).each(function(e,t){var r=n+"-"+u;jQuery(t).attr("name")&&jQuery(t).attr("name",jQuery(t).attr("name").replace(n,r));jQuery(t).attr("for")&&jQuery(t).attr("for",jQuery(t).attr("for").replace(n,r));jQuery(t).attr("id")&&jQuery(t).attr("id",jQuery(t).attr("id").replace(n,r))})};jQuery(document).bind("column_init column_change column_add",function(e,t){jQuery(t).cpac_bind_column_addon_events();jQuery(t).cpac_bind_container_addon_events()});jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),t=e.find("[data-toggle-id] label");t.click(function(){var t=jQuery(this).closest("td.input").data("toggle-id"),n=e.find('[data-indicator-id="'+t+'"]').removeClass("on"),r=jQuery("input",this).val();"on"==r&&n.addClass("on")})};jQuery.fn.cpac_bind_container_addon_events=function(){var e=jQuery(this),t=e.find("[data-indicator-id]");t.unbind("click").click(function(){var t=jQuery(this).data("indicator-id"),n=e.find('[data-toggle-id="'+t+'"] input');if(jQuery(this).hasClass("on")){jQuery(this).removeClass("on").addClass("off");n.filter("[value=off]").prop("checked",!0)}else{jQuery(this).removeClass("off").addClass("on");n.filter("[value=on]").prop("checked",!0)}})};
1
/*
2
* Fires when the dom is ready
3
*
4
+ */function cpac_importexport(){jQuery("#php-export-results textarea").on("focus, mouseup",function(){jQuery(this).select()}).select().focus()}function cpac_addons(){}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_add_column(){jQuery("#cpac .add_column").click(function(e){var t=jQuery(this).closest(".columns-container"),n=jQuery(".for-cloning-only .cpac-column",t).first().clone(),r=t.attr("data-type");if(n.length>0){n.cpac_update_clone_id(r);jQuery(".cpac-columns form",t).append(n);n.column_bind_toggle();n.column_bind_remove();n.column_bind_events();n.addClass("opened").find(".column-form").slideDown(150,function(){jQuery("html, body").animate({scrollTop:n.offset().top-58},300)});cpac_sortable();jQuery(document).trigger("column_add",n)}e.preventDefault()})}function cpac_sidebar_feedback(){jQuery(function(e){var t=e(".sidebox#direct-feedback");t.find("#feedback-choice a.no").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.find("#feedback-support").slideDown()});t.find("#feedback-choice a.yes").click(function(e){e.preventDefault();t.find("#feedback-choice").slideUp();t.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 t=jQuery("#contextual-help-wrap");t.parent().show();jQuery('a[href="#tab-panel-cpac-'+jQuery(this).attr("data-help")+'"]',t).trigger("click");t.slideDown("fast",function(){t.focus()})})}function cpac_pointer(){jQuery(".cpac-pointer").each(function(){var e=jQuery(this),t=e.attr("rel"),n=e.attr("data-pos"),r={at:"left top",my:"right top",edge:"right",offset:"0 0"};"right"==n&&(r={at:"right middle",my:"left middle",edge:"left"});e.pointer({content:jQuery("#"+t).html(),position:r,pointerWidth:250,close:function(){e.removeClass("open")},pointerClass:"wp-pointer wp-pointer-"+r.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,t){var n=jQuery(this).attr("href");if(n){var r=n.replace("#cpac-box-","");jQuery(".cpac-menu a").removeClass("current");jQuery(".columns-container").hide();jQuery(this).addClass("current");var i=jQuery('.columns-container[data-type="'+r+'"]').show(),s=i.find(".cpac-columns");jQuery(document).trigger("cac_menu_change",s)}e.preventDefault()});e.find("a.current").trigger("click")}jQuery(document).ready(function(){if(jQuery("#cpac").length===0)return!1;cpac_pointer();cpac_submit_form();cpac_clear_input_defaults();cpac_sortable();cpac_menu();cpac_help();cpac_add_column();cpac_addons();cpac_importexport();cpac_sidebar_feedback();jQuery(".cpac-column").each(function(e,t){jQuery(t).column_bind_toggle();jQuery(t).column_bind_remove();jQuery(t).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(t){t.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.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(t){var n=jQuery("<div>"+t+"</div>").children();e.replaceWith(n);e=n;e.column_bind_toggle();e.column_bind_remove();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),t=e.closest(".columns-container "),n=t.attr("data-type"),r=e.find(".column_type select option:selected").val();e.find(".column_type select").change(function(){var i=jQuery("optgroup",this).children(":selected"),s=i.val(),o=i.text(),u=jQuery(this).next(".msg").hide(),a=t.find('.for-cloning-only .cpac-column[data-type="'+s+'"]');if(a.length)if(a.find(".is-disabled").length){u.html(a.find(".is-disabled").html()).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected")}else{if(typeof a.attr("data-clone")=="undefined"&&jQuery(".cpac-columns",t).find('[data-type="'+s+'"]').length){u.html(cpac_i18n.clone.replace("%s","<strong>"+o+"</strong>")).show();jQuery(this).find("option").removeAttr("selected");jQuery(this).find('option[value="'+r+'"]').attr("selected","selected");return}var f=a.clone();f.addClass("opened").find(".column-form").show();f.find(".column-meta").replaceWith(e.find(".column-meta"));f.find(".column-form").replaceWith(e.find(".column-form"));f.cpac_update_clone_id(n);e.replaceWith(f);f.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.find(".input-width-range").each(function(){var e=jQuery(this).closest("td").find(".input-width"),t=jQuery(this).closest("td").find(".width-decription"),n=jQuery(e)[0].defaultValue,r=t.attr("title");jQuery(this).slider({range:"min",min:0,max:100,value:n,slide:function(n,i){var s=i.value>0?i.value+"%":r;jQuery(e).val(i.value);jQuery(t).text(s)}})});e.find(".column_image_size label.custom-size").click(function(){var e=jQuery(this).closest(".input");if(jQuery(this).hasClass("image-size-custom")){jQuery(".custom-size-w",e).removeClass("hidden");jQuery(".custom-size-h",e).removeClass("hidden")}else{jQuery(".custom-size-w",e).addClass("hidden");jQuery(".custom-size-h",e).addClass("hidden")}});e.find(".column-form .label label").hover(function(){jQuery(this).find("p.description").show()},function(){jQuery(this).find("p.description").hide()});e.find(".column_type select").val()=="column-meta"&&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.cpac_update_clone_id=function(e){var t=jQuery(this),n=t.attr("data-type"),r=jQuery('.columns-container[data-type="'+e+'"]').find(".cpac-columns"),i=jQuery(r).find('*[data-type="'+n+'"]').not(t),s=jQuery.map(i,function(e,t){return jQuery(e).attr("data-clone")?parseInt(jQuery(e).attr("data-clone"),10):0});s.sort();var o=Math.max.apply(null,s)+1;for(var u=0;u<=o;u++)if(-1===jQuery.inArray(u,s))break;if(0===u)return;t.attr("data-clone",u);t.find("input.clone").val(u);t.find("input.column-name").val(n+"-"+u);var a=t.find("input, select, label");jQuery(a).each(function(e,t){var r=n+"-"+u;jQuery(t).attr("name")&&jQuery(t).attr("name",jQuery(t).attr("name").replace(n,r));jQuery(t).attr("for")&&jQuery(t).attr("for",jQuery(t).attr("for").replace(n,r));jQuery(t).attr("id")&&jQuery(t).attr("id",jQuery(t).attr("id").replace(n,r))})};jQuery(document).bind("column_init column_change column_add",function(e,t){jQuery(t).cpac_bind_column_addon_events();jQuery(t).cpac_bind_container_addon_events()});jQuery.fn.cpac_bind_column_addon_events=function(){var e=jQuery(this),t=e.find("[data-toggle-id] label");t.click(function(){var t=jQuery(this).closest("td.input").data("toggle-id"),n=e.find('[data-indicator-id="'+t+'"]').removeClass("on"),r=jQuery("input",this).val();"on"==r&&n.addClass("on")})};jQuery.fn.cpac_bind_container_addon_events=function(){var e=jQuery(this),t=e.find("[data-indicator-id]");t.unbind("click").click(function(){var t=jQuery(this).data("indicator-id"),n=e.find('[data-toggle-id="'+t+'"] input');if(jQuery(this).hasClass("on")){jQuery(this).removeClass("on").addClass("off");n.filter("[value=off]").prop("checked",!0)}else{jQuery(this).removeClass("off").addClass("on");n.filter("[value=on]").prop("checked",!0)}})};
classes/column.php CHANGED
@@ -165,9 +165,7 @@ class CPAC_Column {
165
}
166
167
// Check whether the column should be available
168
- if ( ! isset( $this->properties['is_registered'] ) ) {
169
- $this->properties['is_registered'] = $this->apply_conditional();
170
- }
171
172
/**
173
* Filter the properties of a column type, such as type and is_cloneable
@@ -665,7 +663,7 @@ class CPAC_Column {
665
* @param array $pieces
666
* @return string Imploded array
667
*/
668
- protected function recursive_implode( $glue, $pieces ) {
669
foreach( $pieces as $r_pieces ) {
670
if ( is_array( $r_pieces ) ) {
671
$retVal[] = $this->recursive_implode( $glue, $r_pieces );
@@ -912,7 +910,6 @@ class CPAC_Column {
912
$column_list = '';
913
914
$groups = $this->storage_model->get_column_type_groups();
915
-
916
foreach ( $groups as $group => $label ) {
917
$column_list .= $this->get_column_list( $this->storage_model->column_types[ $group ], $label );
918
}
@@ -1038,8 +1035,8 @@ class CPAC_Column {
1038
1039
</tbody>
1040
</table>
1041
- </div><!--.column-form-->
1042
- </div><!--.cpac-column-->
1043
<?php
1044
}
1045
}
165
}
166
167
// Check whether the column should be available
168
+ $this->properties['is_registered'] = $this->apply_conditional();
169
170
/**
171
* Filter the properties of a column type, such as type and is_cloneable
663
* @param array $pieces
664
* @return string Imploded array
665
*/
666
+ public function recursive_implode( $glue, $pieces ) {
667
foreach( $pieces as $r_pieces ) {
668
if ( is_array( $r_pieces ) ) {
669
$retVal[] = $this->recursive_implode( $glue, $r_pieces );
910
$column_list = '';
911
912
$groups = $this->storage_model->get_column_type_groups();
913
foreach ( $groups as $group => $label ) {
914
$column_list .= $this->get_column_list( $this->storage_model->column_types[ $group ], $label );
915
}
1035
1036
</tbody>
1037
</table>
1038
+ </div>
1039
+ </div>
1040
<?php
1041
}
1042
}
classes/column/acf-placeholder.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_ACF_Placeholder extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_ID extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/actions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Actions extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/agent.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Agent extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/approved.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Approved extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/author-avatar.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Avatar extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/author-email.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Email extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/author-ip.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Ip extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/author-url.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author_Url extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/author.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Author extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/date-gmt.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Date_Gmt extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/date.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Date extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/excerpt.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Excerpt extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/reply-to.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Reply_To extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/comment/word-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Comment_Word_Count extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/custom-field.php CHANGED
@@ -9,7 +9,7 @@ class CPAC_Column_Custom_Field extends CPAC_Column {
9
10
/**
11
* @see CPAC_Column::init()
12
- * @since 2.3
13
*/
14
function init() {
15
9
10
/**
11
* @see CPAC_Column::init()
12
+ * @since 2.2.1
13
*/
14
function init() {
15
classes/column/default.php CHANGED
@@ -1,12 +1,12 @@
1
<?php
2
/**
3
- * @since 2.3
4
*/
5
class CPAC_Column_Default extends CPAC_Column {
6
7
/**
8
* @see CPAC_Column::init()
9
- * @since 2.3
10
*/
11
public function init() {
12
@@ -18,12 +18,12 @@ class CPAC_Column_Default extends CPAC_Column {
18
}
19
20
/**
21
- * @since 2.3
22
* @see CPAC_Column::get_value()
23
*/
24
public function get_value( $post_id ) {
25
26
- if ( $this->properties->column ) {
27
echo $this->storage_model->get_original_column_value( $this->properties->handle, $post_id );
28
}
29
1
<?php
2
/**
3
+ * @since 2.2.1
4
*/
5
class CPAC_Column_Default extends CPAC_Column {
6
7
/**
8
* @see CPAC_Column::init()
9
+ * @since 2.2.1
10
*/
11
public function init() {
12
18
}
19
20
/**
21
+ * @since 2.2.1
22
* @see CPAC_Column::get_value()
23
*/
24
public function get_value( $post_id ) {
25
26
+ if ( ! empty( $this->properties->handle ) ) {
27
echo $this->storage_model->get_original_column_value( $this->properties->handle, $post_id );
28
}
29
classes/column/link/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_ID extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/link/actions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Actions extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
@@ -50,4 +50,4 @@ class CPAC_Column_Link_Actions extends CPAC_Column {
50
51
return implode( ' | ', $actions );
52
}
53
- }
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
50
51
return implode( ' | ', $actions );
52
}
53
+ }
classes/column/link/description.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Description extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/link/image.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Image extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/link/length.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Length extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/link/notes.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Notes extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/link/owner.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Owner extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/link/rss.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Rss extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/link/target.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Link_Target extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_ID extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/actions.php CHANGED
@@ -9,7 +9,7 @@ class CPAC_Column_Media_Actions extends CPAC_Column {
9
10
/**
11
* @see CPAC_Column::init()
12
- * @since 2.3
13
*/
14
public function init() {
15
9
10
/**
11
* @see CPAC_Column::init()
12
+ * @since 2.2.1
13
*/
14
public function init() {
15
classes/column/media/alternate-text.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Alternate_Text extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/available-sizes.php CHANGED
@@ -9,7 +9,7 @@ class CPAC_Column_Media_Available_Sizes extends CPAC_Column {
9
10
/**
11
* @see CPAC_Column::init()
12
- * @since 2.3
13
*/
14
public function init() {
15
9
10
/**
11
* @see CPAC_Column::init()
12
+ * @since 2.2.1
13
*/
14
public function init() {
15
classes/column/media/caption.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Caption extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/description.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Description extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/dimensions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Dimensions extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/exif-data.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Exif_Data extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/file-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_File_Name extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/file-size.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_File_Size extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/full-path.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Full_Path extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/height.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Height extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/mime-type.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Mime_Type extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/media/width.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Media_Width extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_ID extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/actions.php CHANGED
@@ -8,15 +8,18 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
15
parent::init();
16
17
// Properties
18
- $this->properties['type'] = 'column-actions';
19
- $this->properties['label'] = __( 'Actions', 'cpac' );
20
}
21
22
/**
@@ -24,7 +27,6 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
24
* @since 2.0
25
*/
26
function get_value( $post_id ) {
27
-
28
return $this->get_raw_value( $post_id );
29
}
30
@@ -33,7 +35,6 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
33
* @since 2.0
34
*/
35
function get_raw_value( $post_id ) {
36
-
37
return $this->get_column_value_actions( $post_id );
38
}
39
@@ -48,17 +49,28 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
48
* @return string Actions
49
*/
50
private function get_column_value_actions( $post_id ) {
51
-
52
$actions = array();
53
54
$post = get_post($post_id);
55
$title = _draft_or_post_title();
56
$post_type_object = get_post_type_object( $post->post_type );
57
$can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
58
59
if ( $can_edit_post && 'trash' != $post->post_status ) {
60
$actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
61
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
62
}
63
if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
64
if ( 'trash' == $post->post_status )
@@ -77,6 +89,70 @@ class CPAC_Column_Post_Actions extends CPAC_Column {
77
}
78
}
79
80
return implode(' | ', $actions);
81
}
82
}
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
15
parent::init();
16
17
// Properties
18
+ $this->properties['type'] = 'column-actions';
19
+ $this->properties['label'] = __( 'Actions', 'cpac' );
20
+
21
+ // Options
22
+ $this->options['use_icons'] = false;
23
}
24
25
/**
27
* @since 2.0
28
*/
29
function get_value( $post_id ) {
30
return $this->get_raw_value( $post_id );
31
}
32
35
* @since 2.0
36
*/
37
function get_raw_value( $post_id ) {
38
return $this->get_column_value_actions( $post_id );
39
}
40
49
* @return string Actions
50
*/
51
private function get_column_value_actions( $post_id ) {
52
$actions = array();
53
54
$post = get_post($post_id);
55
$title = _draft_or_post_title();
56
$post_type_object = get_post_type_object( $post->post_type );
57
$can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
58
+ $quickedit_enabled = false;
59
+
60
+ $stored_columns = $this->storage_model->get_stored_columns();
61
+
62
+ foreach ( $stored_columns as $column ) {
63
+ if ( $column['type'] == 'title' ) {
64
+ $quickedit_enabled = true;
65
+ }
66
+ }
67
68
if ( $can_edit_post && 'trash' != $post->post_status ) {
69
$actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
70
+
71
+ if ( $quickedit_enabled ) {
72
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
73
+ }
74
}
75
if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
76
if ( 'trash' == $post->post_status )
89
}
90
}
91
92
+ // Use icons instead of links
93
+ /*
94
+ @todo: debug first
95
+ if ( ! empty( $this->options->use_icons ) ) {
96
+ $icons = array(
97
+ 'edit' => 'edit',
98
+ 'trash' => 'trash',
99
+ 'delete' => 'trash',
100
+ 'untrash' => 'undo',
101
+ 'view' => 'visibility',
102
+ 'inline hide-if-no-js' => 'welcome-write-blog'
103
+ );
104
+
105
+ foreach ( $actions as $action => $link ) {
106
+ if ( isset( $icons[ $action ] ) ) {
107
+ if ( strpos( $link, 'class=' ) === false ) {
108
+ $link = str_replace( '<a ', '<a class="" ', $link );
109
+ }
110
+
111
+ $link = preg_replace( '/class=["\'](.*?)["\']/', 'class="$1 cpac-tip button cpac-button-action dashicons hide-content dashicons-' . $icons[ $action ] . '"', $link, 1 );
112
+ $link = preg_replace_callback( '/>(.*?)<\/a>/', function( $matches ) {
113
+ return ' data-tip="' . esc_attr( $matches[1] ) . '">' . $matches[1] . '</a>';
114
+ }, $link );
115
+
116
+ $actions[ $action ] = $link;
117
+ }
118
+ }
119
+
120
+ return implode( '', $actions );
121
+ }
122
+ */
123
+
124
return implode(' | ', $actions);
125
}
126
+
127
+ /**
128
+ * @see CPAC_Column::display_settings()
129
+ * @since 2.2.4
130
+ */
131
+ public function display_settings() {
132
+
133
+ parent::display_settings();
134
+
135
+ //$this->display_field_use_icons();
136
+ }
137
+
138
+ /**
139
+ * @since 2.2.4
140
+ */
141
+ public function display_field_use_icons() {
142
+ ?>
143
+ <tr class="column_editing">
144
+ <?php $this->label_view( __( 'Use icons?', 'cpac' ), __( 'Use icons instead of text for displaying the actions.', 'cpac' ), 'use_icons' ); ?>
145
+ <td class="input">
146
+ <label for="<?php $this->attr_id( 'use_icons' ); ?>-yes">
147
+ <input type="radio" value="1" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-yes"<?php checked( $this->options->use_icons, '1' ); ?> />
148
+ <?php _e( 'Yes'); ?>
149
+ </label>
150
+ <label for="<?php $this->attr_id( 'use_icons' ); ?>-no">
151
+ <input type="radio" value="" name="<?php $this->attr_name( 'use_icons' ); ?>" id="<?php $this->attr_id( 'use_icons' ); ?>-no"<?php checked( $this->options->use_icons, '' ); ?> />
152
+ <?php _e( 'No'); ?>
153
+ </label>
154
+ </td>
155
+ </tr>
156
+ <?php
157
+ }
158
}
classes/column/post/attachment-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Attachment_Count extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/attachment.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Attachment extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/author-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Author_Name extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/before-moretag.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Before_Moretag extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/comment-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Comment_Count extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/comment-status.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Comment_Status extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
@@ -51,7 +51,6 @@ class CPAC_Column_Post_Comment_Status extends CPAC_Column {
51
* @since 2.0.3
52
*/
53
function get_raw_value( $post_id ) {
54
-
55
return get_post_field( 'comment_status', $post_id, 'raw' );
56
}
57
}
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
51
* @since 2.0.3
52
*/
53
function get_raw_value( $post_id ) {
54
return get_post_field( 'comment_status', $post_id, 'raw' );
55
}
56
}
classes/column/post/excerpt.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Excerpt extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/featured-image.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Featured_Image extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/formats.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
@@ -25,8 +25,9 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
25
*/
26
function apply_conditional() {
27
28
- if ( post_type_supports( $this->storage_model->key, 'post-formats' ) )
29
return true;
30
31
return false;
32
}
@@ -37,8 +38,9 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
37
*/
38
function get_value( $post_id ) {
39
40
- if ( ! $format = $this->get_raw_value( $post_id ) )
41
return false;
42
43
return esc_html( get_post_format_string( $format ) );
44
}
@@ -49,8 +51,9 @@ class CPAC_Column_Post_Formats extends CPAC_Column {
49
*/
50
function get_raw_value( $post_id ) {
51
52
- if ( ! $format = get_post_format( $post_id ) )
53
return false;
54
55
return $format;
56
}
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
25
*/
26
function apply_conditional() {
27
28
+ if ( post_type_supports( $this->storage_model->key, 'post-formats' ) ) {
29
return true;
30
+ }
31
32
return false;
33
}
38
*/
39
function get_value( $post_id ) {
40
41
+ if ( ! ( $format = $this->get_raw_value( $post_id ) ) ) {
42
return false;
43
+ }
44
45
return esc_html( get_post_format_string( $format ) );
46
}
51
*/
52
function get_raw_value( $post_id ) {
53
54
+ if ( ! ( $format = get_post_format( $post_id ) ) ) {
55
return false;
56
+ }
57
58
return $format;
59
}
classes/column/post/modified.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Modified extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/order.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Order extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/page-template.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Page_Template extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/parent.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Parent extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/permalink.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Permalink extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
@@ -79,5 +79,4 @@ class CPAC_Column_Post_Permalink extends CPAC_Column {
79
</tr>
80
<?php
81
}
82
-
83
}
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
79
</tr>
80
<?php
81
}
82
}
classes/column/post/ping-status.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Ping_Status extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/roles.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Roles extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/slug.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Slug extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/status.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Status extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/sticky.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Sticky extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/post/title-raw.php ADDED
@@ -0,0 +1,39 @@
1
+ <?php
2
+ /**
3
+ * CPAC_Column_Post_Title_Raw
4
+ *
5
+ * @since 2.2.4
6
+ */
7
+ class CPAC_Column_Post_Title_Raw extends CPAC_Column {
8
+
9
+ /**
10
+ * @see CPAC_Column::init()
11
+ * @since 2.2.4
12
+ */
13
+ public function init() {
14
+
15
+ parent::init();
16
+
17
+ // Properties
18
+ $this->properties['type'] = 'column-title_raw';
19
+ $this->properties['label'] = __( 'Title without actions', 'cpac' );
20
+ }
21
+
22
+ /**
23
+ * @see CPAC_Column::get_value()
24
+ * @since 2.2.4
25
+ */
26
+ function get_value( $post_id ) {
27
+
28
+ return $this->get_raw_value( $post_id );
29
+ }
30
+
31
+ /**
32
+ * @see CPAC_Column::get_raw_value()
33
+ * @since 2.2.4
34
+ */
35
+ function get_raw_value( $post_id ) {
36
+
37
+ return get_post_field( 'post_title', $post_id );
38
+ }
39
+ }
classes/column/post/word-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_Post_Word_Count extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/taxonomy.php CHANGED
@@ -8,12 +8,12 @@ class CPAC_Column_Taxonomy extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
15
parent::init();
16
-
17
// Properties
18
$this->properties['type'] = 'column-taxonomy';
19
$this->properties['label'] = __( 'Taxonomy', 'cpac' );
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
15
parent::init();
16
+
17
// Properties
18
$this->properties['type'] = 'column-taxonomy';
19
$this->properties['label'] = __( 'Taxonomy', 'cpac' );
classes/column/used-by-menu.php ADDED
@@ -0,0 +1,146 @@
1
+ <?php
2
+ /**
3
+ * CPAC_Column_Post_Modified
4
+ *
5
+ * @since 2.0
6
+ */
7
+ class CPAC_Column_Used_By_Menu extends CPAC_Column {
8
+
9
+ /**
10
+ * @see CPAC_Column::init()
11
+ * @since 2.2.1
12
+ */
13
+ public function init() {
14
+
15
+ parent::init();
16
+
17
+ // Properties
18
+ $this->properties['type'] = 'column-used_by_menu';
19
+ $this->properties['label'] = __( 'Used by Menu', 'cpac' );
20
+
21
+ // Options
22
+ $this->options['link_to_menu'] = false;
23
+ }
24
+
25
+ /**
26
+ * @see CPAC_Column::apply_conditional()
27
+ * @since 2.0
28
+ */
29
+ function apply_conditional() {
30
+ if ( ! $this->get_meta_type() ) {
31
+ return false;
32
+ }
33
+ return true;
34
+ }
35
+
36
+ /**
37
+ * @see CPAC_Column::get_value()
38
+ * @since 2.0
39
+ */
40
+ function get_value( $object_id ) {
41
+
42
+ $menus = array();
43
+ if ( $menu_ids = $this->get_raw_value( $object_id ) ) {
44
+ foreach ( $menu_ids as $menu_id ) {
45
+ $term = get_term_by( 'id', $menu_id, 'nav_menu' );
46
+
47
+ $title = $term->name;
48
+ if ( 'on' == $this->options->link_to_menu ) {
49
+ $title = '<a href="' . esc_url( add_query_arg( array( 'menu' => $menu_id ), admin_url('nav-menus.php') ) ) . '">' . $term->name . '</a>';
50
+ }
51
+
52
+ $menus[] = $title;
53
+ }
54
+ }
55
+
56
+ return implode( ', ', $menus );
57
+ }
58
+
59
+ /**
60
+ * Get object metatype of the storage model
61
+ *
62
+ * @since 2.0.6
63
+ */
64
+ function get_meta_type() {
65
+ $object_type = false;
66
+ if ( isset( $this->storage_model->taxonomy ) ) {
67
+ $object_type = $this->storage_model->taxonomy;
68
+ }
69
+ elseif ( isset( $this->storage_model->post_type ) ) {
70
+ $object_type = $this->storage_model->post_type;
71
+ }
72
+ return $object_type;
73
+ }
74
+
75
+ /**
76
+ * @see CPAC_Column::get_raw_value()
77
+ * @since 2.0.3
78
+ */
79
+ function get_raw_value( $object_id ) {
80
+
81
+ $object_type = $this->get_meta_type();
82
+
83
+
84
+ $menu_item_ids = get_posts( array(
85
+ 'post_type' => 'nav_menu_item',
86
+ 'numberposts' => -1,
87
+ 'post_status' => 'publish',
88
+ 'fields' => 'ids',
89
+ 'meta_query' => array(
90
+ array(
91
+ 'key' => '_menu_item_object_id',
92
+ 'value' => $object_id
93
+ ),
94
+ array(
95
+ 'key' => '_menu_item_object',
96
+ 'value' => $object_type
97
+ ),
98
+ )
99
+ ) );
100
+
101
+ if ( ! $menu_item_ids ) {
102
+ return false;
103
+ }
104
+
105
+ $menu_ids = wp_get_object_terms( $menu_item_ids, 'nav_menu', array( 'fields' => 'ids') );
106
+ if ( ! $menu_ids || is_wp_error( $menu_ids ) ) {
107
+ return false;
108
+ }
109
+
110
+ return $menu_ids;
111
+ }
112
+
113
+ /**
114
+ * @see CPAC_Column::display_settings()
115
+ * @since 2.2.1
116
+ */
117
+ public function display_settings() {
118
+
119
+ $this->display_field_link_to_menu();
120
+ }
121
+
122
+ /**
123
+ * Display the settings field for selecting whether the column value should link to the corresponding post
124
+ *
125
+ * @since 2.2.1
126
+ */
127
+ public function display_field_link_to_menu() {
128
+
129
+ $field_key = 'link_to_menu';
130
+ ?>
131
+ <tr class="column_<?php echo $field_key; ?>">
132
+ <?php $this->label_view( __( 'Link to menu', 'cpac' ), __( 'This will make the title link to the menu.', 'cpac' ), $field_key ); ?>
133
+ <td class="input">
134
+ <label for="<?php $this->attr_id( $field_key ); ?>-on">
135
+ <input type="radio" value="on" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-on"<?php checked( $this->options->link_to_menu, 'on' ); ?> />
136
+ <?php _e( 'Yes'); ?>
137
+ </label>
138
+ <label for="<?php $this->attr_id( $field_key ); ?>-off">
139
+ <input type="radio" value="off" name="<?php $this->attr_name( $field_key ); ?>" id="<?php $this->attr_id( $field_key ); ?>-off"<?php checked( in_array( $this->options->link_to_menu, array( '', 'off' ) ) ); ?> />
140
+ <?php _e( 'No'); ?>
141
+ </label>
142
+ </td>
143
+ </tr>
144
+ <?php
145
+ }
146
+ }
classes/column/user/ID.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_ID extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/actions.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Actions extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/comment-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Comment_Count extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/description.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Description extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/first-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_First_Name extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/last-name.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Last_Name extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/nickname.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Nickname extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/post-count.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Post_Count extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/registered.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Registered extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/column/user/url.php CHANGED
@@ -8,7 +8,7 @@ class CPAC_Column_User_Url extends CPAC_Column {
8
9
/**
10
* @see CPAC_Column::init()
11
- * @since 2.3
12
*/
13
public function init() {
14
8
9
/**
10
* @see CPAC_Column::init()
11
+ * @since 2.2.1
12
*/
13
public function init() {
14
classes/settings.php CHANGED
@@ -876,9 +876,12 @@ class CPAC_Settings {
876
case 'settings' :
877
$this->display_settings();
878
break;
879
- case 'addons':
880
$this->tab_addons();
881
break;
882
default:
883
echo apply_filters( 'cac/settings/tab_contents/tab=' . $current_tab, apply_filters( 'cac/settings/tab_contents', '', $current_tab ) );
884
break;
876
case 'settings' :
877
$this->display_settings();
878
break;
879
+ case 'addons' :
880
$this->tab_addons();
881
break;
882
+ case 'help' :
883
+ //$this->tab_addons();
884
+ break;
885
default:
886
echo apply_filters( 'cac/settings/tab_contents/tab=' . $current_tab, apply_filters( 'cac/settings/tab_contents', '', $current_tab ) );
887
break;
classes/storage_model.php CHANGED
@@ -97,7 +97,7 @@ abstract class CPAC_Storage_Model {
97
$this->set_columns_filepath();
98
99
// Populate columns variable.
100
- // This is used for manage_value. By storing these columns we greatly improve performance.
101
add_action( 'admin_init', array( $this, 'set_columns' ) );
102
}
103
@@ -222,10 +222,11 @@ abstract class CPAC_Storage_Model {
222
*/
223
function store( $columns = '' ) {
224
225
- if ( ! empty( $_POST[ $this->key ] ) )
226
$columns = array_filter( $_POST[ $this->key ] );
227
228
- if( ! $columns ) {
229
cpac_admin_message( __( 'No columns settings available.', 'cpac' ), 'error' );
230
return false;
231
}
@@ -270,7 +271,8 @@ abstract class CPAC_Storage_Model {
270
$columns = array(
271
'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
272
'CPAC_Column_ACF_Placeholder' => CPAC_DIR . 'classes/column/acf-placeholder.php',
273
- 'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php'
274
);
275
276
// Directory to iterate
@@ -452,7 +454,6 @@ abstract class CPAC_Storage_Model {
452
}
453
454
public function get_database_columns() {
455
-
456
return get_option( "cpac_options_{$this->key}" );
457
}
458
@@ -726,11 +727,17 @@ abstract class CPAC_Storage_Model {
726
}
727
728
/**
729
* @since 2.0.5
730
* @return boolean
731
*/
732
function is_doing_ajax() {
733
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
734
return true;
735
}
736
@@ -741,9 +748,11 @@ abstract class CPAC_Storage_Model {
741
* @since 2.0.5
742
* @return boolean
743
*/
744
function is_doing_quick_edit() {
745
return $this->is_doing_ajax() && isset( $_REQUEST['action'] ) && 'inline-save' == $_REQUEST['action'];
746
}
747
748
/**
749
* @since 2.0.3
@@ -755,23 +764,26 @@ abstract class CPAC_Storage_Model {
755
756
global $pagenow;
757
758
- if ( $this->page . '.php' != $pagenow )
759
return false;
760
761
// posttypes
762
if ( 'post' == $this->type ) {
763
$post_type = isset( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : $this->type;
764
765
- if ( $this->key != $post_type )
766
return false;
767
}
768
769
// taxonomy
770
if ( 'taxonomy' == $this->type ) {
771
$taxonomy = isset( $_GET['taxonomy'] ) ? $_GET['taxonomy'] : '';
772
773
- if ( $this->taxonomy != $taxonomy )
774
return false;
775
}
776
777
return true;
97
$this->set_columns_filepath();
98
99
// Populate columns variable.
100
+ // This is used for manage_value.
101
add_action( 'admin_init', array( $this, 'set_columns' ) );
102
}
103
222
*/
223
function store( $columns = '' ) {
224
225
+ if ( ! empty( $_POST[ $this->key ] ) ) {
226
$columns = array_filter( $_POST[ $this->key ] );
227
+ }
228
229
+ if ( ! $columns ) {
230
cpac_admin_message( __( 'No columns settings available.', 'cpac' ), 'error' );
231
return false;
232
}
271
$columns = array(
272
'CPAC_Column_Custom_Field' => CPAC_DIR . 'classes/column/custom-field.php',
273
'CPAC_Column_ACF_Placeholder' => CPAC_DIR . 'classes/column/acf-placeholder.php',
274
+ 'CPAC_Column_Taxonomy' => CPAC_DIR . 'classes/column/taxonomy.php',
275
+ 'CPAC_Column_Used_By_Menu' => CPAC_DIR . 'classes/column/used-by-menu.php'
276
);
277
278
// Directory to iterate
454
}
455
456
public function get_database_columns() {
457
return get_option( "cpac_options_{$this->key}" );
458
}
459
727
}
728
729
/**
730
+ * Whether this request is an AJAX request and marked as admin-column-ajax request.
731
+ *
732
* @since 2.0.5
733
* @return boolean
734
*/
735
function is_doing_ajax() {
736
+ if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
737
+ return false;
738
+ }
739
+
740
+ if ( ( isset( $_POST['plugin_id'] ) && 'cpac' == $_POST['plugin_id'] ) || ( isset( $_GET['plugin_id'] ) && 'cpac' == $_GET['plugin_id'] ) ) {
741
return true;
742
}
743
748
* @since 2.0.5
749
* @return boolean
750
*/
751
+ /*
752
function is_doing_quick_edit() {
753
return $this->is_doing_ajax() && isset( $_REQUEST['action'] ) && 'inline-save' == $_REQUEST['action'];
754
}
755
+ */
756
757
/**
758
* @since 2.0.3
764
765
global $pagenow;
766
767
+ if ( $this->page . '.php' != $pagenow ) {
768
return false;
769
+ }
770
771
// posttypes
772
if ( 'post' == $this->type ) {
773
$post_type = isset( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : $this->type;
774
775
+ if ( $this->key != $post_type ) {
776
return false;
777
+ }
778
}
779
780
// taxonomy
781
if ( 'taxonomy' == $this->type ) {
782
$taxonomy = isset( $_GET['taxonomy'] ) ? $_GET['taxonomy'] : '';
783
784
+ if ( $this->taxonomy != $taxonomy ) {
785
return false;
786
+ }
787
}
788
789
return true;
classes/storage_model/post.php CHANGED
@@ -30,6 +30,7 @@ class CPAC_Storage_Model_Post extends CPAC_Storage_Model {
30
// values
31
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value' ), 100, 2 );
32
33
add_action( 'load-edit.php', array( $this, 'set_columns' ), 1000 );
34
35
parent::__construct();
30
// values
31
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'manage_value' ), 100, 2 );
32
33
+ // @todo: description
34
add_action( 'load-edit.php', array( $this, 'set_columns' ), 1000 );
35
36
parent::__construct();
codepress-admin-columns.php CHANGED
@@ -2,7 +2,7 @@
2
/*
3
4
Plugin Name: Codepress Admin Columns
5
- Version: 2.2.4
6
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.
7
Author: Codepress
8
Author URI: http://www.codepresshq.com
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
}
34
35
// Plugin information
36
- define( 'CPAC_VERSION', '2.2.4' ); // current plugin version
37
define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // this is the latest version which requires an upgrade
38
define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
39
define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
@@ -148,25 +148,22 @@ class CPAC {
148
}
149
150
/**
151
- * Whether this request is an AJAX request
152
*
153
* @since 2.2
154
* @return bool Returns true if in an AJAX request, false otherwise
155
*/
156
function is_doing_ajax() {
157
158
- $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
159
160
- /**
161
- * Filter whether the current request should be marked as an AJAX request
162
- * Useful for custom AJAX calls
163
- *
164
- * @since 2.2
165
- * @param bool $doing_ajax Whether the current request is an AJAX request
166
- */
167
- $doing_ajax = apply_filters( 'cac/is_doing_ajax', $doing_ajax );
168
169
- return $doing_ajax;
170
}
171
172
/**
@@ -218,6 +215,7 @@ class CPAC {
218
* @return bool Whether the current screen is an Admin Columns screen
219
*/
220
function is_cac_screen() {
221
/**
222
* Filter whether the current screen is a screen in which Admin Columns is active
223
*
@@ -235,20 +233,22 @@ class CPAC {
235
add_action( 'admin_head', array( $this, 'global_head_scripts') );
236
237
wp_register_script( 'cpac-admin-columns', CPAC_URL . 'assets/js/admin-columns.js', array( 'jquery', 'jquery-qtip2' ), CPAC_VERSION );
238
239
if ( $this->is_columns_screen() ) {
240
add_filter( 'admin_body_class', array( $this, 'admin_class' ) );
241
add_action( 'admin_head', array( $this, 'admin_scripts') );
242
243
wp_enqueue_script( 'cpac-admin-columns' );
244
245
$data = array();
246
247
- if ( $storage_model = $this->get_current_storage_model() ) {
248
$data['storage_model'] = array(
249
'is_table_header_fixed' => $storage_model->is_table_header_fixed()
250
);
251
- }
252
253
wp_localize_script( 'cpac-admin-columns', 'CPAC', $data );
254
@@ -273,8 +273,9 @@ class CPAC {
273
*/
274
public function set_storage_models() {
275
276
- if ( ! $this->is_cac_screen() )
277
return;
278
279
$storage_models = array();
280
@@ -407,13 +408,8 @@ class CPAC {
407
* @return string
408
*/
409
function admin_class( $classes ) {
410
-
411
- if ( $this->storage_models ) {
412
- foreach ( $this->storage_models as $storage_model ) {
413
- if ( $storage_model->is_columns_screen() ) {
414
- $classes .= " cp-{$storage_model->key}";
415
- }
416
- }
417
}
418
419
return $classes;
2
/*
3
4
Plugin Name: Codepress Admin Columns
5
+ Version: 2.2.5
6
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.
7
Author: Codepress
8
Author URI: http://www.codepresshq.com
33
}
34
35
// Plugin information
36
+ define( 'CPAC_VERSION', '2.2.5' ); // current plugin version
37
define( 'CPAC_UPGRADE_VERSION', '2.0.0' ); // this is the latest version which requires an upgrade
38
define( 'CPAC_URL', plugin_dir_url( __FILE__ ) );
39
define( 'CPAC_DIR', plugin_dir_path( __FILE__ ) );
148
}
149
150
/**
151
+ * Whether this request is an AJAX request and marked as admin-column-ajax request.
152
*
153
* @since 2.2
154
* @return bool Returns true if in an AJAX request, false otherwise
155
*/
156
function is_doing_ajax() {
157
158
+ if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
159
+ return false;
160
+ }
161
162
+ if ( ( isset( $_POST['plugin_id'] ) && 'cpac' == $_POST['plugin_id'] ) || ( isset( $_GET['plugin_id'] ) && 'cpac' == $_GET['plugin_id'] ) ) {
163
+ return true;
164
+ }
165
166
+ return false;
167
}
168
169
/**
215
* @return bool Whether the current screen is an Admin Columns screen
216
*/
217
function is_cac_screen() {
218
+
219
/**
220
* Filter whether the current screen is a screen in which Admin Columns is active
221
*
233
add_action( 'admin_head', array( $this, 'global_head_scripts') );
234
235
wp_register_script( 'cpac-admin-columns', CPAC_URL . 'assets/js/admin-columns.js', array( 'jquery', 'jquery-qtip2' ), CPAC_VERSION );
236
+ wp_register_script( 'jquery-floatthead', CPAC_URL . 'external/floatThead/jquery.floatThead.js', array( 'jquery' ), CPAC_VERSION );
237
238
if ( $this->is_columns_screen() ) {
239
add_filter( 'admin_body_class', array( $this, 'admin_class' ) );
240
add_action( 'admin_head', array( $this, 'admin_scripts') );
241
242
wp_enqueue_script( 'cpac-admin-columns' );
243
+ wp_enqueue_script( 'jquery-floatthead' );
244
245
$data = array();
246
247
+ /*if ( $storage_model = $this->get_current_storage_model() ) {
248
$data['storage_model'] = array(
249
'is_table_header_fixed' => $storage_model->is_table_header_fixed()
250
);
251
+ }*/
252
253
wp_localize_script( 'cpac-admin-columns', 'CPAC', $data );
254
273
*/
274
public function set_storage_models() {
275
276
+ if ( ! $this->is_cac_screen() ) {
277
return;
278
+ }
279
280
$storage_models = array();
281
408
* @return string
409
*/
410
function admin_class( $classes ) {
411
+ if ( $storage_model = $this->get_current_storage_model() ) {
412
+ $classes .= " cp-{$storage_model->key}";
413
}
414
415
return $classes;
external/floatthead/jquery.floatThead.js ADDED
@@ -0,0 +1,757 @@