Plugin Directory

Changeset 2995262


Ignore:
Timestamp:
11/13/2023 03:49:33 PM (2 years ago)
Author:
flei
Message:

v0.2.2: version fix in plugin file, readme update

Location:
admin-columns-for-acf-fields
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin-columns-for-acf-fields/tags/0.2.2/acf_admin_columns.php

    r2994024 r2995262  
    44 * Plugin URI: https://wordpress.org/plugins/acf-admin-columns/
    55 * Description: Add columns for your ACF fields to post and taxonomy index pages in the WP backend.
    6  * Version: 0.2.1
     6 * Version: 0.2.2
    77 * Author: Florian Eickhorst
    88 * Author URI: http://www.fleimedia.com/
  • admin-columns-for-acf-fields/tags/0.2.2/readme.txt

    r2994024 r2995262  
    6666**Parameters**
    6767
    68     $fields - Array of all ACF fields to be shown in current screen.
     68    $acf_columns - Array of all ACF fields to be shown in current screen. Note that the column key is always prefixed with 'acf_'.
    6969    $field_groups - Array of all ACF field groups to be shown in current screen.
    7070
    7171**Example:**
    7272
    73 Remove 'my_field' from the columns of the post type 'my_custom_post_type', even if it is set to be shown in the field settings.
    74 
    75     function my_admin_columns($fields, $field_groups) {
     73Remove 'my_field' from the columns of the post type 'my_custom_post_type', even if it is set to be shown in the field settings. Note that the column key is always prefixed with 'acf_'.
     74
     75    function my_admin_columns($acf_columns, $field_groups) {
    7676
    7777        $screen = get_current_screen();
    78         if (!empty($screen) && $screen->post_type == 'my_custom_post_type' && isset($fields['my_field'])) {
    79             unset($fields['my_field']);
    80         }
    81         return $fields;
    82     }
    83     add_filter('acf/admin_columns/admin_columns','my_admin_columns', 10, 3);
     78        if (!empty($screen) && $screen->post_type == 'my_custom_post_type' && isset($acf_columns['acf_my_field'])) {
     79            unset($acf_columns['acf_my_field']); // the key is always prefixed with 'acf_'
     80        }
     81        return $acf_columns;
     82    }
     83    add_filter('acf/admin_columns/admin_columns','my_admin_columns', 10, 2);
    8484
    8585= "acf/admin_columns/sortable_columns" =
     
    9797**Parameters**
    9898
    99     $sort_order_type - The sort order type (either 'string' or 'numeric')
     99    $sort_order_type - The sort order type (either 'meta_value' or 'meta_value_num')
    100100    $field_properties - the ACF field properties
    101101
     
    160160= "acf/admin_columns/default_value" =
    161161
    162 Allows you to override the default value for a certain field if it is empty. This only works, if the field has a default value set in the field settings.
     162Allows you to override the default value for a certain field if it is empty. This only applies, if the field has a default value set in the field settings.
    163163
    164164**Parameters**
     
    335335    add_filter('acf/admin_columns/exclude_field_types','my_exclude_field_types');
    336336
    337 = "acf/admin_columns/preview_image_url" =
    338 Allows for manipulation of the url of the preview image.
    339 
    340 **Parameters**
    341 $preview_image_url - string with image url
    342 
    343 
    344337== Installation ==
    345338
     
    352345== Frequently Asked Questions ==
    353346
    354 === How can I change the preview image size of image and gallery fields? ===
     347= How can I change the preview image size of image and gallery fields? =
    355348
    356349Use the filter "acf/admin_columns/preview_image_size" to change the preview image size. See "Filters" section above for details.
  • admin-columns-for-acf-fields/trunk/acf_admin_columns.php

    r2994022 r2995262  
    44 * Plugin URI: https://wordpress.org/plugins/acf-admin-columns/
    55 * Description: Add columns for your ACF fields to post and taxonomy index pages in the WP backend.
    6  * Version: 0.2.1
     6 * Version: 0.2.2
    77 * Author: Florian Eickhorst
    88 * Author URI: http://www.fleimedia.com/
  • admin-columns-for-acf-fields/trunk/readme.txt

    r2994023 r2995262  
    6666**Parameters**
    6767
    68     $fields - Array of all ACF fields to be shown in current screen.
     68    $acf_columns - Array of all ACF fields to be shown in current screen. Note that the column key is always prefixed with 'acf_'.
    6969    $field_groups - Array of all ACF field groups to be shown in current screen.
    7070
    7171**Example:**
    7272
    73 Remove 'my_field' from the columns of the post type 'my_custom_post_type', even if it is set to be shown in the field settings.
    74 
    75     function my_admin_columns($fields, $field_groups) {
     73Remove 'my_field' from the columns of the post type 'my_custom_post_type', even if it is set to be shown in the field settings. Note that the column key is always prefixed with 'acf_'.
     74
     75    function my_admin_columns($acf_columns, $field_groups) {
    7676
    7777        $screen = get_current_screen();
    78         if (!empty($screen) && $screen->post_type == 'my_custom_post_type' && isset($fields['my_field'])) {
    79             unset($fields['my_field']);
    80         }
    81         return $fields;
    82     }
    83     add_filter('acf/admin_columns/admin_columns','my_admin_columns', 10, 3);
     78        if (!empty($screen) && $screen->post_type == 'my_custom_post_type' && isset($acf_columns['acf_my_field'])) {
     79            unset($acf_columns['acf_my_field']); // the key is always prefixed with 'acf_'
     80        }
     81        return $acf_columns;
     82    }
     83    add_filter('acf/admin_columns/admin_columns','my_admin_columns', 10, 2);
    8484
    8585= "acf/admin_columns/sortable_columns" =
     
    9797**Parameters**
    9898
    99     $sort_order_type - The sort order type (either 'string' or 'numeric')
     99    $sort_order_type - The sort order type (either 'meta_value' or 'meta_value_num')
    100100    $field_properties - the ACF field properties
    101101
     
    160160= "acf/admin_columns/default_value" =
    161161
    162 Allows you to override the default value for a certain field if it is empty. This only works, if the field has a default value set in the field settings.
     162Allows you to override the default value for a certain field if it is empty. This only applies, if the field has a default value set in the field settings.
    163163
    164164**Parameters**
     
    335335    add_filter('acf/admin_columns/exclude_field_types','my_exclude_field_types');
    336336
    337 = "acf/admin_columns/preview_image_url" =
    338 Allows for manipulation of the url of the preview image.
    339 
    340 **Parameters**
    341 $preview_image_url - string with image url
    342 
    343 
    344337== Installation ==
    345338
     
    352345== Frequently Asked Questions ==
    353346
    354 === How can I change the preview image size of image and gallery fields? ===
     347= How can I change the preview image size of image and gallery fields? =
    355348
    356349Use the filter "acf/admin_columns/preview_image_size" to change the preview image size. See "Filters" section above for details.
Note: See TracChangeset for help on using the changeset viewer.