public function column_post_title($post) { $edit_flag = esc_url(add_query_arg(array('post_id' => $post->ID), 'admin.php?page=ap_post_flag')); if ($post->post_type == 'question') { $title = '<a href="' . $edit_flag . '" class="row-title">' . $post->post_title . '</a>'; } else { $title = '<a href="' . $edit_flag . '" class="row-title">' . ap_truncate_chars(strip_tags($post->post_content), 80) . '</a>'; } $actions = array(); $actions['edit_flag'] = sprintf('<a href="%s">%s</a>', $edit_flag, __('Edit flags', 'ap')); if ('trash' == $this->current_status) { $actions['untrash'] = sprintf('<a href="%s">%s</a>', ap_untrash_post($post->ID), __('Restore', 'ap')); $actions['delete'] = sprintf('<a href="%s">%s</a>', get_delete_post_link($post->ID, null, true), __('Delete permanently', 'ap')); } else { $actions['edit'] = sprintf('<a href="%s">%s</a>', get_edit_post_link($post->ID), __('Edit', 'ap')); $actions['trash'] = sprintf('<a href="%s">%s</a>', get_delete_post_link($post->ID), __('Trash', 'ap')); $actions['view'] = sprintf('<a href="%s">%s</a>', get_permalink($post->ID), __('View', 'ap')); } return sprintf('%1$s %2$s', $title, $this->row_actions($actions)); }
public function column_post_title($post) { if ($post->post_type == 'question') { $title = '<a href="' . esc_url(add_query_arg(array('post' => $post->ID, 'action' => 'edit'), 'post.php')) . '" class="row-title">' . $post->post_title . '</a>'; } else { $title = '<a href="' . esc_url(add_query_arg(array('post' => $post->ID, 'action' => 'edit'), 'post.php')) . '" class="row-title">' . ap_truncate_chars(strip_tags($post->post_content), 80) . '</a>'; } if ('trash' == $this->current_status) { $actions = array('untrash' => sprintf('<a href="%s">%s</a>', ap_untrash_post($post->ID), __('Restore', 'anspress-question-answer')), 'delete' => sprintf('<a href="%s">%s</a>', get_delete_post_link($post->ID, null, true), __('Delete permanently', 'anspress-question-answer'))); } else { $actions = array('edit' => sprintf('<a href="%s">%s</a>', get_edit_post_link($post->ID), __('Edit', 'anspress-question-answer')), 'trash' => sprintf('<a href="%s">%s</a>', get_delete_post_link($post->ID), __('Trash', 'anspress-question-answer')), 'view' => sprintf('<a href="%s">%s</a>', get_permalink($post->ID), __('View', 'anspress-question-answer'))); } return sprintf('%1$s %2$s', $title, $this->row_actions($actions)); }