WordPress.org

Ready to get started?Download WordPress

Forums

Woocommerce - How are the attribute tables generated? (2 posts)

  1. walshie1987
    Member
    Posted 6 months ago #

    Hi All,

    I'm really struggling with this one.

    I've installed Woocommence and I've made a few mods to certain tables and written a few scripts to update them which are working fine.

    I want to tidy up the admin panel so I can edit the info here instead of having to log into myphpadmin to update the tables.

    What I'm having problems with is:

    I log into wordpress admin and click on Products -> Attributes, I then click on "Configure Terms" on one of my terms and i'm taken to the next page displaying a list of all of my attributes (e.g. /wp-admin/edit-tags.php?taxonomy=pa_colour&post_type=product).

    This page has a table in with the headings "Name", "Description", "Slug" and "Products". I want to add my column info into this which is called "Includes". This column is location in table wp_term_taxonomy which the above info is also stored in.

    I'm ok with PHP but I simply cannot figure out where the headers and info for this page are generated.

    Any help would be much appreciated!

    Cheers
    Chris

  2. bcworkz
    Member
    Posted 6 months ago #

    I know nothing of woocommerce, but if their tables are based on the same thing as all the other tables in a default WP installation, they are based on the WP_List_Table class, defined in wp-admin/includes/. All the default tables are based on extensions of this, they each have their own file defining the extension.

    The columns are hardcoded in the class, but can be modified via filter. Similarly, an action fires for each cell for any added custom column giving you the opportunity to output table data. Documentation is scarce for all but a few table types, but the information more or less transfers to any table type since they all are based on the same base class. Take a look at manage_{$post_type}_posts_columns. Be sure to look at the related filters and actions linked at the bottom to get a full picture.

    Even if this does not apply to woocommerce, someone might find it useful. Sorry if this does not help you.

Reply

You must log in to post.

About this Topic