Hi @hwuser,
Thank you for reaching out.
Could you please try removing the public keyword before function so you’re left with the below and see if that helps?
add_filter( 'tec_event_statuses', 'my_custom_statuses', 20, 2 );
function my_custom_statuses( $statuses, $current_status ) {
$custom_statuses = $this->custom_statuses();
foreach ( $custom_statuses as $custom_status ) {
$statuses[] = [
'text' => $custom_status[ 'name' ],
'id' => $custom_status[ 'value' ],
'value' => $custom_status[ 'value' ],
'selected' => $custom_status[ 'value' ] === $current_status ? true : false,
];
}
return $statuses;
}
function custom_statuses() {
$statuses = [
'rescheduled' => [
'name' => 'Rescheduled',
'value' => 'rescheduled',
'schema' => 'EventRecheduled',
],
'suspended' => [
'name' => 'Suspended',
'value' => 'suspended',
'schema' => '',
],
];
return $statuses;
}
Plugin Support
Darian
(@d0153)
Hi there,
It seems like it has been some time since we received a response from you, therefore, I will consider this matter as resolved. If you require any further assistance, please do not hesitate to start a new thread.
Thread Starter
hwuser
(@hwuser)
Sorry, I don’t have much time to do tests.
I have removed the public, but now it does not recognize the $this->
It gives me the following error:
PHP Fatal error: Uncaught Error: Using $this when not in object context
I think you should replicate it yourself and put the good code on the website… So I don’t have to do tests…
Thanks!!
Plugin Support
Darian
(@d0153)
Hi @hwuser
I appreciate you bringing this to our attention and I assure you that we will take the necessary steps to address this issue. I will consult with the appropriate team to gather more information, and once I have more information, I will keep you updated.
Thank you again for your patience and understanding.
Plugin Support
Darian
(@d0153)
Hi @hwuser
Thanks for patiently waiting. Please try to remove the $this to resolve the issue.
From $custom_statuses = $this->custom_statuses();
to
$custom_statuses = custom_statuses();
Let me know how it goes.
Plugin Support
Darian
(@d0153)
Hi there,
It seems like this thread has been quiet for a bit, so we’ll go ahead and mark it as resolved. However, if any further questions or concerns come up, please don’t hesitate to start a new thread.
Thread Starter
hwuser
(@hwuser)
Hello, I already told you that I haven’t been able to try it because I don’t have time to do what you tell me. I understand that you who are the authors of the plugin will have to test this.