Support

Search results for ""

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

Support for EventOn?

I have the Start Date and End Date showing for Admin Columns Pro on the “Events” post type (from EventON). But on Export, the Start Date and End Date do not show.

3 years, 8 months ago
Stefan
Developer

Hi Vincent,

Currently, it is not supported to export third-party columns. We’re trying to come up with a solution for this, but it is not that easy because of the way columns are registered in WordPress.

But I believe there is a workaround for you. Most plugins use custom meta data to store their data. So if the start and end date from the EventON plugin are stored as metadata, you could try to remove their default columns and re-add them by using our custom field columns. When you use one of our columns, export will work.

3 years, 8 months ago
Vincent

Thanks for the effort, Stefan. Unfortunately, the start date and end date aren’t options in Custom Fields, for that plugin. :( It has a lot of other custom fields, but not those ones.

3 years, 8 months ago
Stefan
Developer

In that case, you can use our filter to alter the export value for the specific columns.

/**
 * @param string $value
 * @param AC_Column $column
 * @param int $post_id
 */
function acp_export_value_custom_date( $value, $column, $post_id ){
	// Check for specific column type
	if( 'the_custom_column_type' === $column->get_type() ){
		$value = 'Your own value';
	}

	return $value;
}
add_filter( 'ac/export/value', 'acp_export_value_custom_date', 10, 3 );

The type returned by get_type() should be the column type the EventON is using, something like start_date. I suspect they have an API or function to get the start and end date for each event. Could you try this out and let me know if it works?

3 years, 8 months ago
Vincent

Hey Stefan, this is for a website that’s currently live, and used by other admins besides us. Can you explain what this will do when I add it?

the_custom_column_type should likely be start_date, but won’t “Your own value” be output, instead of the date itself?

3 years, 8 months ago
Stefan
Developer

Hi Vincent,

The snippet I gave you is a filter that allows you to change the export value just before it is written to the CSV.
You can paste the snippet in your function.php but you indeed have to change the following values in your code:

the_custom_columns_type should indeed something be like start_date, but I don’t know that for sure.

Your own value is also something you have to set yourself by using the API of EventON. I did have a quick look on their documentation section but I could not find any API methods to help you with this. You’ll have to find out how you can get the start date and end date by using code before you can use this snippet.

3 years, 7 months ago

You must be logged in to reply to this topic.