is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status']; $this->set_pagination_args( array( 'total_items' => $wp_query->found_posts, 'total_pages' => $wp_query->max_num_pages, 'per_page' => $wp_query->query_vars['posts_per_page'], ) ); $this->items = $wp_query->posts; /* -- Register the Columns -- */ $columns = $this->get_columns(); $hidden = array( 'id', ); $this->_column_headers = array( $columns, $hidden, $this->get_sortable_columns() ) ; remove_filter( 'posts_where', array( &$this, 'modify_post_status_to_private' ) ); } function modify_post_status_to_private( $where ) { return str_replace( "post_status = 'inherit' ", "post_status = 'arfaly-mass' ", $where ); } function get_bulk_actions() { $actions = array(); $actions['delete'] = __( 'Delete Permanently', 'arfaly-uploader' ); $actions['approve'] = __( 'Approve', 'arfaly-uploader' ); if ( $this->detached ) $actions['attach'] = __( 'Attach to a post', 'arfaly-uploader' ); return $actions; } function current_action() { if ( isset( $_REQUEST['find_detached'] ) ) return 'find_detached'; if ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) ) return 'attach'; if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) return 'delete_all'; return parent::current_action(); } function has_items() { return have_posts(); } function no_items() { __( 'No media attachments found.', 'arfaly-uploader' ); } function get_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; $posts_columns['icon'] = ''; /* translators: column name */ $posts_columns['title'] = _x( 'File', 'column name' ); $posts_columns['author'] = __( 'Author', 'arfaly-uploader' ); /* translators: column name */ if ( !$this->detached ) { $posts_columns['parent'] = _x( 'Attached to', 'column name' ); } /* translators: column name */ $posts_columns['date'] = _x( 'Date', 'column name' ); $posts_columns = apply_filters( 'manage_arfaly_media_columns', $posts_columns, $this->detached ); return $posts_columns; } function display_rows() { global $post, $id; add_filter( 'the_title', 'esc_html' ); $alt = ''; while ( have_posts() ) : the_post(); if ( $this->is_trash && $post->post_status != 'trash' || !$this->is_trash && $post->post_status == 'trash' ) continue; if ( $post->post_status == 'inherit' ) continue; $alt = ( 'alternate' == $alt ) ? '' : 'alternate'; $post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other' ; $att_title = _draft_or_post_title(); ?>
ID ), $matches ) ) echo esc_html( strtoupper( $matches[1] ) ); else echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) ); ?>
row_actions( $this->_get_row_actions( $post, $att_title ) ); ?>