Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Robert

How do I make these columns?

How can I get started adding these kinds of columns to my setup… ?
What pointers do I need?

<u>Post list:</u>

1.
Author but with avatar
On a post list, show Author name but with his/her avatar, just like on the User list. I think this is non-standard behaviour for a post list but it appeals to me. “Username” would suffice.

2.
User taxonomy term, but on post list
Post list: As above, Users have a taxonomy, “Firm”, attached – let’s say a value is “Widgets Inc”. On a post list, alongside the Author/Username, I’d like to add a column for the “Firm” (ie. taxonomy term) he/she has attached. And, ideally, this would, as above, also echo out “firm_company_logo”, a term meta field.

<u>User list</u>:

1.
Wrap User meta fields in HTML anchorI have User meta fields like “Website” or custom meta “Twitter” (ACF text field).
I know I can natively show “Website” with the Type dropdown and “Twitter” using either “Custom Field ” or the “Advanced Custom Fields” dropdown item.
But let’s say I wanted to make “Website” or “Twitter” in to URLs. How could I output a value like[website]” or “@[twitter]“? Whilst Custom Field supports Before and After, I don’t see a way to re-echo the value twice.

2.
Taxonomy term with term meta
That is, User has taxonomy “Firm” attached – let’s say a value is “Widgets Inc”. I can natively show a column for the “Firm” name – but how do I also show some of the meta for the term?
eg. 1. meta field called “firm_company_logo”, which is an ACF image field?
eg. 2. meta field called “firm_site_url” which is an ACF URL field?

Thanks.

3 years, 6 months ago
Stefan
Developer

Hi Robert,

I will explain below how you can create the columns needed.

Post List – Author Column
You can add our Author column (found in the custom section) and change the display property to Name or Gravatar. If you want both the name and image, you’ll have to add this column twice since we don’t have a column that shows both these fields

Post List – Author Taxonomy
Unfortunately, this is not possible out of the box with our plugin. We don’t have an option to show relational data from a user on the post overview other than the fields that can be found in the Author column as mentioned above. Besides that, by default it is not possible to add taxonomies to a User.

Wrap Meta Values in HTML
The before and after setting allows you to add markup before and after the actual value but as you already mentioned, it is not possible to echo the value twice. The only way to do this, is by using the following hook.

ac/column/value

Taxonomy meta on User overview
This is the same as the author taxonomy. It is not possible to show related taxonomy data on the user overview page.
If you’re a developer you could write your own column to do this. We do have some documentation about how to create your own column.

Creating a new column type

3 years, 6 months ago
Robert

1.

Post List – Author Column
You can add our Author column (found in the custom section) and change the display property to Name or Gravatar. If you want both the name and image, you’ll have to add this column twice since we don’t have a column that shows both these fields

There is no avatar field on the dropdown, even the one under Custom; only these – https://imgur.com/a/ovRmO

2.

Post List – Author Taxonomy
… Besides that, by default it is not possible to add taxonomies to a User.

Although WordPress does not support taxonomies for users out of the box, as objects, users can support this. I have been using the plugin LH User Taxonomies for some time to successfully attach taxonomies to users. I am just curious how I can get the terms to show on a column.

I will look in to the rest. Thanks.

3 years, 6 months ago
Stefan
Developer

1) I believe you don’t use the latest version of our plugin. The gravatar display options was added in 4.2.4 if I’m correct.

2) We don’t support our Taxonomy column on the User overview page because it would require us to create a dependency on that specific plugin. but you can still create a column to show the terms on the overview page (without our filtering and sorting logic though). When you have a look at the documentation of register_taxonomy, you can see that there is an argument show_admin_column which you can enable a column for that taxonomy. This seems to work on the user overview page as well.

https://codex.wordpress.org/Function_Reference/register_post_type

3 years, 6 months ago
Robert

Thanks. A couple more things re: 1) —

* I updated from 4.2.3 to 4.2.4. Now I get the Gravatar option. However, I cannot update the ACF add-on and it is now non-functional: “This add-on is no longer compatible with the current version of Admin Columns Pro. Add-on should be at least version 2.2.2.” How can I restore this asap?

* Although Gravatar shows successfully, this is not actually the right option. I think it should be “avatar”. It’s not just a difference in words. Avatar and Gravatar can be different things. And, in my case, I have filtered avatar to use a locally-hosted file – but it’s still a legitimate native output of avatar, as opposed to Gravatar. Almost no-one on my site uses a Gravatar, meaning this option displays almost nothing.

3 years, 6 months ago
Robert

I solved the ACF add-on name change by downloading the new version, adding it, enabling it and removing the previous one.

3 years, 6 months ago
Robert

This is interesting…

If I try to add a column for *my* avatar field (which is an ACF Image field, set up as Image Array…

… ACP throws an error on the post listing…

3 years, 6 months ago

You must be logged in to reply to this topic.