| @@ -66,10 +66,10 @@ | ||
| 66 | 66 | $current = isset( $_GET['post_status'] ) ? $_GET['post_status'] : ''; |
| 67 | 67 | $count_any = $counts->publish + $counts->draft + $counts->future + $counts->pending; |
| 68 | 68 | |
| 69 | 69 | return array( |
| 70 | - '' => sprintf( '<a href="%s" class="%s">%s</a> (%d)', esc_url( remove_query_arg( 'post_status' ) ), $current == '' ? 'current' : '', __( 'All', 'html-forms' ), $count_any ), | |
| 71 | - 'trash' => sprintf( '<a href="%s" class="%s">%s</a> (%d)', esc_url( add_query_arg( array( 'post_status' => 'trash' ) ) ), $current == 'trash' ? 'current' : '', __( 'Trash', 'html-forms' ), $counts->trash ), | |
| 70 | + '' => sprintf( '<a href="%s" class="%s">%s</a> (%d)', remove_query_arg( 'post_status' ), $current == '' ? 'current' : '', __( 'All', 'html-forms' ), $count_any ), | |
| 71 | + 'trash' => sprintf( '<a href="%s" class="%s">%s</a> (%d)', add_query_arg( array( 'post_status' => 'trash' ) ), $current == 'trash' ? 'current' : '', __( 'Trash', 'html-forms' ), $counts->trash ), | |
| 72 | 72 | ); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| @@ -85,9 +85,9 @@ | ||
| 85 | 85 | |
| 86 | 86 | return $actions; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $actions['trash'] = __( 'Delete Permanently', 'html-forms' ); | |
| 89 | + $actions['trash'] = __( 'Move to Trash', 'html-forms' ); | |
| 90 | 90 | $actions['duplicate'] = __( 'Duplicate', 'html-forms' ); |
| 91 | 91 | |
| 92 | 92 | return $actions; |
| 93 | 93 | } |
| @@ -110,9 +110,8 @@ | ||
| 110 | 110 | return array( |
| 111 | 111 | 'cb' => '<input type="checkbox" />', |
| 112 | 112 | 'form_name' => __( 'Form', 'html-forms' ), |
| 113 | 113 | 'shortcode' => __( 'Shortcode', 'html-forms' ), |
| 114 | - 'submissions' => __( 'Submissions', 'html-forms' ), | |
| 115 | 114 | ); |
| 116 | 115 | } |
| 117 | 116 | |
| 118 | 117 | /** |
| @@ -206,27 +205,11 @@ | ||
| 206 | 205 | if ( $this->is_trash ) { |
| 207 | 206 | return ''; |
| 208 | 207 | } |
| 209 | 208 | |
| 210 | - return sprintf( '<input type="text" onfocus="this.select();" readonly="readonly" value="%s">', esc_attr( '[hf_form slug="' . $form->slug . '"]' ) ); | |
| 209 | + return sprintf( '<input style="width: 260px;" type="text" onfocus="this.select();" readonly="readonly" value="%s">', esc_attr( '[hf_form slug="' . $form->slug . '"]' ) ); | |
| 211 | 210 | } |
| 212 | 211 | |
| 213 | - /** | |
| 214 | - * @param Form $form | |
| 215 | - * | |
| 216 | - * @return string | |
| 217 | - */ | |
| 218 | - public function column_submissions( Form $form ) { | |
| 219 | - $edit_link = admin_url( 'admin.php?page=html-forms&view=edit&form_id=' . $form->ID ); | |
| 220 | - $submissions = hf_count_form_submissions( $form->id ); | |
| 221 | - | |
| 222 | - if ($submissions == 0 || $this->is_trash) { | |
| 223 | - return $submissions; | |
| 224 | - } else { | |
| 225 | - return sprintf( '<a href="' . esc_attr( add_query_arg( array( 'tab' =>'submissions' ), $edit_link ) ) . '">' . $submissions . '</a>'); | |
| 226 | - } | |
| 227 | - } | |
| 228 | - | |
| 229 | 212 | /** |
| 230 | 213 | * The text that is shown when there are no items to show |
| 231 | 214 | */ |
| 232 | 215 | public function no_items() { |
| @@ -241,12 +224,8 @@ | ||
| 241 | 224 | if ( empty( $action ) ) { |
| 242 | 225 | return false; |
| 243 | 226 | } |
| 244 | 227 | |
| 245 | - if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-' . $this->_args['plural'] ) ) { | |
| 246 | - return false; | |
| 247 | - } | |
| 248 | - | |
| 249 | 228 | $method = 'process_bulk_action_' . $action; |
| 250 | 229 | $forms = (array) $_REQUEST['forms']; |
| 251 | 230 | if ( method_exists( $this, $method ) ) { |
| 252 | 231 | return call_user_func_array( array( $this, $method ), array( $forms ) ); |
| @@ -275,17 +254,17 @@ | ||
| 275 | 254 | } |
| 276 | 255 | } |
| 277 | 256 | |
| 278 | 257 | public function process_bulk_action_trash( $forms ) { |
| 279 | - array_map( 'wp_trash_post', $forms ); | |
| 258 | + return array_map( 'wp_trash_post', $forms ); | |
| 280 | 259 | } |
| 281 | 260 | |
| 282 | 261 | public function process_bulk_action_delete( $forms ) { |
| 283 | - array_map( 'wp_delete_post', $forms ); | |
| 262 | + return array_map( 'wp_delete_post', $forms ); | |
| 284 | 263 | } |
| 285 | 264 | |
| 286 | 265 | public function process_bulk_action_untrash( $forms ) { |
| 287 | - array_map( 'wp_untrash_post', $forms ); | |
| 266 | + return array_map( 'wp_untrash_post', $forms ); | |
| 288 | 267 | } |
| 289 | 268 | |
| 290 | 269 | /** |
| 291 | 270 | * Generates content for a single row of the table |