• Resolved alone69li

    (@alone69li)


    Hello!
    Thank you very much for this plugin, testing before buying the Pro version.
    Please tell me how you can display the AСF fields on the output page of all messages (/wp-admin/edit.php?post_type=af_entry)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter alone69li

    (@alone69li)

    // Add the custom columns to the book post type:
    add_filter( 'manage_af_entry_posts_columns', 'set_custom_edit_book_columns' );
    function set_custom_edit_book_columns($columns) {
        $columns['name_user'] = __( 'Name', 'mydomain' );
        return $columns;
    }
    
    // Add the data to the custom columns for the book post type:
    add_action( 'manage_af_entry_posts_custom_column' , 'custom_book_column', 10, 2 );
    function custom_book_column( $column, $post_id ) {
        switch ( $column ) {
            case 'name_user' :
                echo get_field('name');
                break;
        }
    }

    https://wordpress.stackexchange.com/questions/253640/adding-custom-columns-to-custom-post-types

    • This reply was modified 4 years, 9 months ago by alone69li.
    Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi!

    The solution you linked is the right way. I do belive you’ll need to pass the $post_id to get_field as well: echo get_field( 'name', $post_id );.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add columns per page Entries’ is closed to new replies.