/** * output function. */ public function output($atts = array()) { $this->submit_handler(); $this->submit(); } /** * Submit Step */ public function submit() { $event = get_post($this->event_id); if (empty($this->event_id) || $event->post_status !== 'publish' && !event_manager_user_can_edit_pending_submissions()) { echo wpautop(__('Invalid listing', 'gam-event-manager')); return; } $this->init_fields(); foreach ($this->fields as $group_key => $group_fields) { foreach ($group_fields as $key => $field) { if (!isset($this->fields[$group_key][$key]['value'])) { if ('event_title' === $key) { $this->fields[$group_key][$key]['value'] = $event->post_title; } elseif ('event_description' === $key) { $this->fields[$group_key][$key]['value'] = $event->post_content; } elseif (!empty($field['taxonomy'])) { $this->fields[$group_key][$key]['value'] = wp_get_object_terms($event->ID, $field['taxonomy'], array('fields' => 'ids'));
case 'publish': $actions['edit'] = array('label' => __('Edit', 'wp-event-manager'), 'nonce' => false); if (is_event_cancelled($event)) { $actions['mark_not_cancelled'] = array('label' => __('Mark not cancelled', 'wp-event-manager'), 'nonce' => true); } else { $actions['mark_cancelled'] = array('label' => __('Mark cancelled', 'wp-event-manager'), 'nonce' => true); } break; case 'expired': if (event_manager_get_permalink('submit_event_form')) { $actions['relist'] = array('label' => __('Relist', 'wp-event-manager'), 'nonce' => true); } break; case 'pending_payment': case 'pending': if (event_manager_user_can_edit_pending_submissions()) { $actions['edit'] = array('label' => __('Edit', 'wp-event-manager'), 'nonce' => false); } break; } $actions['delete'] = array('label' => __('Delete', 'wp-event-manager'), 'nonce' => true); $actions = apply_filters('event_manager_my_event_actions', $actions, $event); foreach ($actions as $action => $value) { $action_url = add_query_arg(array('action' => $action, 'event_id' => $event->ID)); if ($value['nonce']) { $action_url = wp_nonce_url($action_url, 'event_manager_my_event_actions'); } echo '<li><a href="' . esc_url($action_url) . '" class="event-dashboard-action-' . esc_attr($action) . '">' . esc_html($value['label']) . ' </a></li>'; } ?> </ul>