Customize List within Admin Panel - Wordpress

Asked

Viewed 424 times

3

I am in a project, I need to make some changes exactly within the Wordpress panel. More specifically on a page that lists a specific list of posts.

  • I need to add a custom search field with a specific field.
  • I also need to add a few more columns in the same table.

I checked the wordpress documentation. But it is something very superficial, not very explanatory.

Someone already had to do?.

Thank you.

  • Already tried to find some plugin that does what you want?

  • Your description is very generic. Put a screen print you want to modify and explain what goes where. If possible with some code you have tried and which error you had, then it is easier to help.

  • If you find the WP documentation shallow, I’m afraid you’ll be surprised negatively by some of the things you’ll find around.

  • 1

1 answer

1


See in this example taken from Codex, how you can add / manipulate columns :

/* Display custom column */
function display_posts_stickiness( $column, $post_id ) {
    if ($column == 'sticky'){
        echo '<input type="checkbox" disabled', ( is_sticky( $post_id ) ? ' checked' : ''), '/>';
    }
}
add_action( 'manage_posts_custom_column' , 'display_posts_stickiness', 10, 2 );

/* Add custom column to post list */
function add_sticky_column( $columns ) {
    return array_merge( $columns, 
        array( 'sticky' => __( 'Sticky', 'your_text_domain' ) ) );
}
add_filter( 'manage_posts_columns' , 'add_sticky_column' );

Reference : https://codex.wordpress.org/Plugin_API/Action_Reference/manage_posts_custom_column

As for the custom search field, what kind of information would you like to filter / search ?

Anyway see in the link below some examples of possible filters : https://www.sitepoint.com/customized-wordpress-administration-filters/

  • That’s just what I needed. Well explained and detailed links. Thank you.. + 1 /\

Browser other questions tagged

You are not signed in. Login or sign up in order to post.