﻿=== WP Admin Columns – Easy Admin Columns Builder for WordPress – Custom Post Types, Taxonomy, Users & More ===
Contributors: dipankarpal212  
Plugin URI: https://profiles.wordpress.org/dipankarpal212  
Donate link: https://www.paypal.me/dipoo7
Tags: column, columns, taxonomy-column, post-type, wp-columns
Requires at least: 5.8  
Tested up to: 6.8  
Requires PHP: 7.4  
Stable tag: 1.0.5  
License: GPLv2 or later  
License URI: https://www.gnu.org/licenses/gpl-2.0.html  
Playground: true

Customize WordPress admin columns for post types, users, taxonomies & more. Add, reorder, or remove columns easily – no coding needed.

== Description ==

**WP Admin Columns** gives you complete control over the WordPress admin columns for any post type.

- ✅ Add, edit, and remove columns from a simple interface  
- ✅ Select or deselect all columns using the top-left checkbox  
- ✅ Display post meta, static text, or use your own callback for full customization  
- ✅ Works with all registered post types *(restricted types require Pro)*  
- ✅ Beautiful, responsive interface

⚠️ **Pro-Only Features**  
- 🔄 Drag & drop column reordering  
- 🧩 Code editor popup for editing filter hook callbacks  
- 🛒 WooCommerce post type support  

---

### 🔍 Key Features

- Add/edit/remove any admin columns  
- Enable/disable columns per post type  
- Supports core fields, post fields, meta fields, additional fields and custom fields  
- Filter hook provided per column for rendering output  
- Clean, intuitive UI  
- Works with all custom post types  
- *(Pro)* Drag & drop reordering  
- *(Pro)* Built-in editor for custom callbacks  

---

### 🧩 Column Types Explained  
*(In the “Edit Columns” popup for each post type)*

1. **Core Field** – Native WordPress columns (e.g., Title, Date)  
   - Only the label is editable  
   - To customize, uncheck and re-add it as a custom field

2. **Post Field** – Columns from the `wp_posts` table (e.g., post_status, post_author)  
   - Label is editable  
   - Output can be modified via filter hook only

3. **Meta Field** – Auto-detected from the `postmeta` table  
   - Label is editable  
   - Do **not** change the meta key — it must match the database exactly

4. **Custom Field** – Fully flexible  
   - Set your own key and label  
   - Use the hook to render any content  
   - Ideal for developers or integrating third-party fields

5. **Additional Field** –
   - Useful derived values like featured image, word count etc. 
   - Filter hook can be used to modify the content  

---

== Installation ==

1. Upload the plugin to `/wp-content/plugins/post-type-column-editor` or install via the Plugins screen  
2. Activate it through **Plugins → Installed Plugins**  
3. Go to **WP-Admin → Column Editor** to configure your columns  

---

== Frequently Asked Questions ==

= Does this work with custom post types? =  
Yes, all registered post types will appear. *(Some types like WooCommerce are Pro-only.)*

= Can I show ACF fields in a column? =  
Yes! In Pro plugin the ACF fields can be shown.

= How do I use a custom callback to render column content? =  
Click **“Show Hook”** on the column to see the filter hook. Copy the snippet into your theme's `functions.php` file and return your custom output.  
*(Pro version includes an inline code editor.)*

= What is the filter hook? =  
Developers can extend the `WP Admin Columns` using WordPress filter hooks. Below is a key filter provided by the plugin:
Use this filter to control what gets displayed in custom columns:

`add_filter( "ptcm_screen_column_value_{$screen_type}_{$post_type}_{$column_key}", function( $value, $post_id , $screen_data) { ... }, 10, 3 );`

This hook allows you to customize the content displayed in your custom admin columns based on the post type and the column key.

🧪 Code Snippet:
```php
<?php
/**
*  `$`screen_type = "post" , `$`post_type = "page",  `$`column_key = "author_name"
*/
add_filter("ptcm_screen_column_value_post_page_author_name", function(`$`value, `$`post_id , `$`screen_data ) {
    return `$`value;
}, 10, 2);`


== Screenshots ==
1. Walkthrough.
2. Admin UI – edit columns in a clean popup.
3. Example of a additional fields shown in the post list table.
4. Hook preview with `copy` feature.
5. Backend settings page
6. Help section

== Changelog ==

= 1.0.0 =  
* Initial release  
* Support for core/post/meta/custom fields  
* Enable/disable columns  
* Show hook callback preview  
* Bulk selection support
* Dedicated Settings page

= 1.0.1 =  
* Introduced hooks in various places.
* Support locate template facilities

= 1.0.2 =  
* Renamed label in various places.
* Added Fields Type select2 Dropdown functionalities.
* Minimised number of rows in the popup.

= 1.0.3 =  
* Fine tuning jquery methods.
* Resolve 'Show Hook' trigger and modified the logic.
* Styled checkboxes - backend settings

= 1.0.4 =  
* author_picture added.
* ptcmData Object manipulated for col_types and sources.
* Removed 'field_group_labels' from ptcmData
* UI Style improve
* Change the Hookname and arguments for modifying column data

= 1.0.5 =  
* Show Hook - popup UI modification
* Modification of some custom filter and action hhoks in JS.
* Introduced Help tab for each screen (enabled by the users).



== Upgrade Notice ==

= 1.0.0 =  
First release of the WP Admin Columns – Easy Admin Columns Builder for WordPress – Custom Post Types, Taxonomy, Users & More .

== Credits ==

Developed by Dipankar Pal(dipankarpal212)

== License ==

This plugin is licensed under the GPLv2 or later.
