| 开发者 | vistromdigital |
|---|---|
| 更新时间 | 2024年2月9日 22:48 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.3.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
Using the filter below, you can prevent taxonomies from being rendered as a result of this plugin.
add_filter('vistrom_media_unsupported_taxonomy_names', function () { return [ 'names-to-blacklist' // Your taxonomy name ]; });
Using the actions below it's possible to add your own custom fields to each respective bulk edit view. The views are located in the following folder /views/admin/media/ ` // Grid modal add_action('vistrom_media_bulk_edit_grid_start', 'render_my_field'); add_action('vistrom_media_bulk_edit_grid_end', 'render_my_field'); // List view add_action('vistrom_media_bulk_edit_list_start', 'render_my_field'); add_action('vistrom_media_bulk_edit_list_left_column_start', 'render_my_field'); add_action('vistrom_media_bulk_edit_list_left_column_end', 'render_my_field'); add_action('vistrom_media_bulk_edit_list_center_column_start', 'render_my_field'); add_action('vistrom_media_bulk_edit_list_center_column_end', 'render_my_field'); add_action('vistrom_media_bulk_edit_list_right_column_start', 'render_my_field'); add_action('vistrom_media_bulk_edit_list_right_column_end', 'render_my_field'); add_action('vistrom_media_bulk_edit_list_end', 'render_my_field'); function render_my_field() { echo ""; } `
To save the fields added to the bulk edit views, you can use the following actions. All supported taxonomies are saved automatically. ` add_action('vistrom_media_before_bulk_update', 'save_my_field', 10, 2); add_action('vistrom_media_after_bulk_update', 'save_my_field', 10, 2); function save_my_field($postIds, $postData) { foreach ($postIds as $id) { update_post_meta($id, 'custom_field', $postData['custom_field']); } } `