{"id":2992,"date":"2024-02-23T09:27:58","date_gmt":"2024-02-23T09:27:58","guid":{"rendered":"https:\/\/helpcenter.greyd.io\/customize-post-backend-interface\/"},"modified":"2024-12-26T18:28:06","modified_gmt":"2024-12-26T17:28:06","slug":"customize-post-backend-interface","status":"publish","type":"post","link":"https:\/\/helpcenter.greyd.io\/customize-post-backend-interface\/","title":{"rendered":"Can I customize the post backend interface?"},"content":{"rendered":"

When working with complex post types, you might want to customize the columns in the WordPress backend to have a clearer overview of your posts, e.g. add custom columns, hide certain columns or have a custom order. This is something we plan to add to Greyd.Suite in the upcoming months. <\/p>\n

In the meantime, we have prepared a code snippet you that you can adapt and add for example to the functions.php of your child theme:<\/p>\n

\/\/ change this to your post type slug\n$my_cpt_slug = 'my_custom_post_type';\n\n\/\/ add the column to the post type\nadd_filter( 'manage_' . $my_cpt_slug . '_posts_columns', function ( $columns ) {\n\n\t\/\/ change 'field' to the name of your column\n\t$column_name = 'my_column_name';\n\n\t$columns[ $column_name ] = __( 'Feld' );\n\treturn $columns;\n} );\n\n\/\/ render the column content\nadd_action( 'manage_' . $my_cpt_slug . '_posts_custom_column', function ( $column, $post_id ) {\n\n\t\/\/ change 'field' to the name of your column\n\t$column_name = 'my_column_name';\n\n\t\/\/ change this to the key of your meta field\n\t$meta_field_key = 'my_custom_field_key';\n\n\t\/\/ render the column content\n\tif ( $column_name === $column ) {\n\t\techo get_dynamic_field( $meta_field_key, $post_id );\n\t}\n\n}, 10, 2);\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

When working with complex post types, you might want to customize the columns in the WordPress backend to have a clearer overview of your posts, e.g. add custom columns, hide certain columns or have a custom order. This is something we plan to add to Greyd.Suite in the upcoming months. In the meantime, we have […]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"greyd_block_editor_preview":[],"footnotes":""},"categories":[1],"tags":[],"topics":[580],"class_list":["post-2992","post","type-post","status-publish","format-standard","hentry","category-general","topics-templates-post-types"],"lang":"en","translations":{"en":2992,"de":2991},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/posts\/2992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/comments?post=2992"}],"version-history":[{"count":1,"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/posts\/2992\/revisions"}],"predecessor-version":[{"id":4750,"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/posts\/2992\/revisions\/4750"}],"wp:attachment":[{"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/media?parent=2992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/categories?post=2992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/tags?post=2992"},{"taxonomy":"topics","embeddable":true,"href":"https:\/\/helpcenter.greyd.io\/wp-json\/wp\/v2\/topics?post=2992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}