give_get_forms_label_singular(), // Singular name of the listed records 'plural' => give_get_forms_label_plural(), // Plural name of the listed records 'ajax' => false // Does this table support ajax? ) ); } /** * This function renders most of the columns in the list table. * * @access public * @since 1.0 * * @param array $item Contains all the data of the form * @param string $column_name The name of the column * * @return string Column Name */ public function column_default( $item, $column_name ) { $donation_list_page_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); switch ( $column_name ) { case 'complete_sales': $value = $item[ $column_name ] ? sprintf( '%s', add_query_arg( array( 'status' => 'publish', 'gateway' => $item['ID'] ), $donation_list_page_url ), $item[ $column_name ] ) : $item[ $column_name ]; break; case 'pending_sales': $value = $item[ $column_name ] ? sprintf( '%s', add_query_arg( array( 'status' => 'pending', 'gateway' => $item['ID'] ), $donation_list_page_url ), $item[ $column_name ] ) : $item[ $column_name ]; break; case 'total_sales': $value = $item[ $column_name ] ? sprintf( '%s', add_query_arg( array( 'gateway' => $item['ID'] ), $donation_list_page_url ), $item[ $column_name ] ) : $item[ $column_name ]; break; default: $value = $item[ $column_name ]; } return $value; } /** * Retrieve the table columns * * @access public * @since 1.0 * @return array $columns Array of all the list table columns */ public function get_columns() { $columns = array( 'label' => esc_attr__( 'Gateway', 'give' ), 'complete_sales' => esc_attr__( 'Complete Payments', 'give' ), 'pending_sales' => esc_attr__( 'Pending / Failed Payments', 'give' ), 'total_sales' => esc_attr__( 'Total Payments', 'give' ), 'total_donations' => esc_attr__( 'Total Donated', 'give' ) ); return $columns; } /** * Get the sortable columns * * @access public * @since 1.8.12 * @return array Array of all the sortable columns */ public function get_sortable_columns() { return array( 'total_donations' => array( 'total_donations', false ) ); } /** * Retrieve the current page number * * @access public * @since 1.0 * @return int Current page number */ public function get_paged() { return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; } /** * Outputs the reporting views * * @access public * @since 1.0 * @return void */ public function bulk_actions( $which = '' ) { } /** * Generate the table navigation above or below the table * * @since 1.0 * @access protected * * @param string $which */ protected function display_tablenav( $which ) { if ( 'top' === $which ) { wp_nonce_field( 'bulk-' . $this->_args['plural'] ); } ?>