Title: Shuffle Plugin &#8211; Suggestions
Last modified: August 19, 2016

---

# Shuffle Plugin – Suggestions

 *  Resolved [th23](https://wordpress.org/support/users/th23/)
 * (@th23)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/shuffle-plugin-suggestions/)
 * Indeed a very cool plugin – just something that should have been standard in 
   WP functionality itself! Glad you took care of adding that functionality 🙂
 * Two suggestions from my side playing a little bit around with it:
 * 1) Add option “Shuffle attached media” as (hover) link under post title in “Attached
   to” column in Media Library view
 * 2) Add option “Detach” as (hover) link under post title in “Attached to” column(
   and remove separate “Detach” column to save some space) in Media Library view
 * Would be cool to hear, what others say – or even cooler if you could add that
   functionality!

Viewing 1 replies (of 1 total)

 *  Thread Starter [th23](https://wordpress.org/support/users/th23/)
 * (@th23)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/shuffle-plugin-suggestions/#post-1788880)
 * I played around with the code a bit – and came up with the following solution
   to my requests.
 * 1) Open the “shuffle.php” file
 * 2) Replace
 *     ```
       function shuffle_columns($defaults) {
       	$defaults['shuffle'] = __('Detach');
       	return $defaults;
       }
       add_filter('manage_media_columns', 'shuffle_columns');
   
       function shuffle_custom_column($column_name, $id) {
           if ($column_name === 'shuffle') {
           	$parent = (int) get_post_field('post_parent', (int) $id);
   
       		if ($parent > 0) {
       			printf('<a href="admin.php?action=shuffle_detach&post_id=%d">%s</a>', $id, __('Detach'));
       		}
           }
       }
       add_action('manage_media_custom_column', 'shuffle_custom_column', 10, 2);
       ```
   
 * 3) Insert instead
 *     ```
       function th23_shuffle_media_columns($defaults) {
       	$defaults_new = array();
       	foreach ($defaults as $default_key => $default_value) {
       		if ($default_key == 'parent') {
       			$default_key = 'th23_attached_to';
       			$default_value = __('Attached to');
       		}
       		$defaults_new[$default_key] = $default_value;
       	}
       	$defaults = $defaults_new;
       	return $defaults;
       }
       add_filter('manage_media_columns', 'th23_shuffle_media_columns');
   
       function th23_shuffle_media_custom_column($column_name, $id) {
           if ($column_name == 'th23_attached_to') {
           	$parent_id = (int) get_post_field('post_parent', (int) $id);
       		if ( $parent_id > 0 ) {
       			//$parent = get_post($parent_id);
       			//print_r($parent);
       			//'<a href="post.php?post=' . $parent['ID'] . '&action=edit">' . $parent->post_title . '</a>';
   
       			echo '<strong><a href="' . get_edit_post_link($parent_id) . '">' . _draft_or_post_title($parent_id) . '</a></strong>, ' . get_the_time(__('Y/m/d'), $parent_id) . '<br />';
       			echo '<div class="row-actions"><a class="hide-if-no-js" onclick="findPosts.open(\'media[]\',\'' . $id . '\');return false;" href="#the-list">' . __('Re-Attach') . '</a> | <a href="admin.php?action=shuffle_detach&post_id=' . $id . '">' . __('Detach') . '</a> | ' . shuffle_do_link($parent_id, __('Shuffle Media')) . '</div>';
       		} else {
       			echo __('(Unattached)') . '<br />';
       			echo '<div class="row-actions"><a class="hide-if-no-js" onclick="findPosts.open(\'media[]\',\'' . $id . '\');return false;" href="#the-list">' . __('Attach') . '</a></div>';
       		}
       	}
       }
       add_action('manage_media_custom_column', 'th23_shuffle_media_custom_column', 10, 2);
       ```
   
 * Alternatively modify the existing functions accordingly…
 * That’s it – hope this helps someone 🙂

Viewing 1 replies (of 1 total)

The topic ‘Shuffle Plugin – Suggestions’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shuffle_8c8c8f.svg)
 * [Shuffle](https://wordpress.org/plugins/shuffle/)
 * [Support Threads](https://wordpress.org/support/plugin/shuffle/)
 * [Active Topics](https://wordpress.org/support/plugin/shuffle/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shuffle/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shuffle/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [th23](https://wordpress.org/support/users/th23/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/shuffle-plugin-suggestions/#post-1788880)
 * Status: resolved