<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How to Hook into the Media Upload Popup Interface	</title>
	<atom:link href="https://www.shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/feed" rel="self" type="application/rss+xml" />
	<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface</link>
	<description>Adventures in WordPress</description>
	<lastBuildDate>Wed, 03 May 2017 21:53:23 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9</generator>
	<item>
		<title>
		By: Mark Bowen		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-920618</link>

		<dc:creator><![CDATA[Mark Bowen]]></dc:creator>
		<pubDate>Wed, 03 May 2017 21:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-920618</guid>

					<description><![CDATA[Hi there,

First of all sorry for dragging everyone back into an old discussion but I was wondering if anyone knows of any way of getting the search field to have focus (the caret to be inside the field) as soon as the media library window opens?

I have a LOT of images on a certain site and would like to be able to just start typing the name of an image as soon as the window opens in order to drill down the images shown.

Thanks in advance if anyone knows of any way of doing this.

Best wishes,

Mark]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>First of all sorry for dragging everyone back into an old discussion but I was wondering if anyone knows of any way of getting the search field to have focus (the caret to be inside the field) as soon as the media library window opens?</p>
<p>I have a LOT of images on a certain site and would like to be able to just start typing the name of an image as soon as the window opens in order to drill down the images shown.</p>
<p>Thanks in advance if anyone knows of any way of doing this.</p>
<p>Best wishes,</p>
<p>Mark</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mark		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-832065</link>

		<dc:creator><![CDATA[Mark]]></dc:creator>
		<pubDate>Tue, 21 Jul 2015 09:53:51 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-832065</guid>

					<description><![CDATA[How Can I add PDF filter to this popup?]]></description>
			<content:encoded><![CDATA[<p>How Can I add PDF filter to this popup?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Gerry		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-790531</link>

		<dc:creator><![CDATA[Gerry]]></dc:creator>
		<pubDate>Fri, 01 May 2015 04:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-790531</guid>

					<description><![CDATA[Hi,

Thanks for great tutorial. I would like to get the post-slug when user drops image into text area (WP 4.1.1) and upload thick box appears.

I&#039;ve tried it using the filtering but the post slug does not get saved!
http://wordpress.stackexchange.com/questions/183196/why-does-post-slug-not-get-saved-for-drafts

Any help greatly appreciated

Gerry]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for great tutorial. I would like to get the post-slug when user drops image into text area (WP 4.1.1) and upload thick box appears.</p>
<p>I&#8217;ve tried it using the filtering but the post slug does not get saved!<br />
<a href="http://wordpress.stackexchange.com/questions/183196/why-does-post-slug-not-get-saved-for-drafts" rel="nofollow ugc">http://wordpress.stackexchange.com/questions/183196/why-does-post-slug-not-get-saved-for-drafts</a></p>
<p>Any help greatly appreciated</p>
<p>Gerry</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Javi		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-66254</link>

		<dc:creator><![CDATA[Javi]]></dc:creator>
		<pubDate>Fri, 22 Mar 2013 17:54:24 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-66254</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49388&quot;&gt;Claire&lt;/a&gt;.

Thanks Claire
I was looking for a solution of this type]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49388">Claire</a>.</p>
<p>Thanks Claire<br />
I was looking for a solution of this type</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ShibaShake		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49430</link>

		<dc:creator><![CDATA[ShibaShake]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 04:42:21 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-49430</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49388&quot;&gt;Claire&lt;/a&gt;.

Great to hear! Thanks for posting your solution.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49388">Claire</a>.</p>
<p>Great to hear! Thanks for posting your solution.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Claire		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49388</link>

		<dc:creator><![CDATA[Claire]]></dc:creator>
		<pubDate>Sun, 06 Jan 2013 18:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-49388</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49298&quot;&gt;ShibaShake&lt;/a&gt;.

:) ... Found a way - for now at least

This into functions.php (wonder if it will show it here):

/* BACKEND ONLY SHOW POSTS OF CURRENT USER _ THAT*S NOT AN ADMIN */

add_action(&#039;pre_get_posts&#039;, &#039;filter_posts_list&#039;);
function filter_posts_list($query)
{
    //$pagenow holds the name of the current page being viewed
     global $pagenow;
 
    //$current_user uses the get_currentuserinfo() method to get the currently logged in user&#039;s data
     global $current_user;
     get_currentuserinfo();
     
        //Shouldn&#039;t happen for the admin, but for any role with the edit_posts capability and only on the posts list page, that is edit.php
        if(!current_user_can(&#039;administrator&#039;) &#038;&#038; current_user_can(&#039;edit_posts&#039;) &#038;&#038; (&#039;edit.php&#039; == $pagenow))
     {
        //global $query&#039;s set() method for setting the author as the current user&#039;s id
        $query-&#062;set(&#039;author&#039;, $current_user-&#062;ID);
        $screen = get_current_screen();
        add_filter(&#039;views_&#039;.$screen-&#062;id, &#039;remove_post_counts&#039;);
        }
}

function remove_post_counts($posts_count_disp)
{
    //$posts_count_disp contains the 3 links, we keep &#039;Mine&#039; and remove the other two.
    unset($posts_count_disp[&#039;all&#039;]);
        unset($posts_count_disp[&#039;publish&#039;]);
     
        return $posts_count_disp;
}


... and then in my custom admin.css I added:

.media-frame-content .attachment-filters:first-child {
display:none;
}


Also, I spoke with Vladimir, the developer of the &quot;User role editor&quot; on the WP repository, and he then created this plugin that hides other users images, which can be useful for others (might as well add here, in case others are searching too):
http://wordpress.org/extend/plugins/view-own-posts-media-only/
:)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49298">ShibaShake</a>.</p>
<p>🙂 &#8230; Found a way &#8211; for now at least</p>
<p>This into functions.php (wonder if it will show it here):</p>
<p>/* BACKEND ONLY SHOW POSTS OF CURRENT USER _ THAT*S NOT AN ADMIN */</p>
<p>add_action(&#8216;pre_get_posts&#8217;, &#8216;filter_posts_list&#8217;);<br />
function filter_posts_list($query)<br />
{<br />
    //$pagenow holds the name of the current page being viewed<br />
     global $pagenow;</p>
<p>    //$current_user uses the get_currentuserinfo() method to get the currently logged in user&#8217;s data<br />
     global $current_user;<br />
     get_currentuserinfo();</p>
<p>        //Shouldn&#8217;t happen for the admin, but for any role with the edit_posts capability and only on the posts list page, that is edit.php<br />
        if(!current_user_can(&#8216;administrator&#8217;) &amp;&amp; current_user_can(&#8216;edit_posts&#8217;) &amp;&amp; (&#8216;edit.php&#8217; == $pagenow))<br />
     {<br />
        //global $query&#8217;s set() method for setting the author as the current user&#8217;s id<br />
        $query-&gt;set(&#8216;author&#8217;, $current_user-&gt;ID);<br />
        $screen = get_current_screen();<br />
        add_filter(&#8216;views_&#8217;.$screen-&gt;id, &#8216;remove_post_counts&#8217;);<br />
        }<br />
}</p>
<p>function remove_post_counts($posts_count_disp)<br />
{<br />
    //$posts_count_disp contains the 3 links, we keep &#8216;Mine&#8217; and remove the other two.<br />
    unset($posts_count_disp[&#8216;all&#8217;]);<br />
        unset($posts_count_disp[&#8216;publish&#8217;]);</p>
<p>        return $posts_count_disp;<br />
}</p>
<p>&#8230; and then in my custom admin.css I added:</p>
<p>.media-frame-content .attachment-filters:first-child {<br />
display:none;<br />
}</p>
<p>Also, I spoke with Vladimir, the developer of the &#8220;User role editor&#8221; on the WP repository, and he then created this plugin that hides other users images, which can be useful for others (might as well add here, in case others are searching too):<br />
<a href="http://wordpress.org/extend/plugins/view-own-posts-media-only/" rel="nofollow ugc">http://wordpress.org/extend/plugins/view-own-posts-media-only/</a><br />
🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ShibaShake		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49298</link>

		<dc:creator><![CDATA[ShibaShake]]></dc:creator>
		<pubDate>Sat, 05 Jan 2013 17:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-49298</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49151&quot;&gt;Claire&lt;/a&gt;.

&lt;blockquote&gt;Is this even possible – and if yes, do you know how?&lt;/blockquote&gt;

The thing with WordPress is that most things are possible, but what you describe may require a fair amount of work. 

I am only starting to play around with the new media manager interface, so I don&#039;t know all of its ins and outs yet. If I were to attempt what you describe, I would probably create a new javascript class that extends from the existing media.controller.Library class. It is in the &lt;a href=&quot;http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-includes/js/media-views.js.source.html&quot; rel=&quot;nofollow&quot;&gt;media-views.js file&lt;/a&gt;.

Not sure at this point if this would be the best class, but it would be my current best guess. 

Another possibility, is that there may be a way to hook into the existing ajax calls to return our own queries. This may be easier to do, but it would be more messy and difficult to maintain in the future.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49151">Claire</a>.</p>
<blockquote><p>Is this even possible – and if yes, do you know how?</p></blockquote>
<p>The thing with WordPress is that most things are possible, but what you describe may require a fair amount of work. </p>
<p>I am only starting to play around with the new media manager interface, so I don&#8217;t know all of its ins and outs yet. If I were to attempt what you describe, I would probably create a new javascript class that extends from the existing media.controller.Library class. It is in the <a href="http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-includes/js/media-views.js.source.html" rel="nofollow">media-views.js file</a>.</p>
<p>Not sure at this point if this would be the best class, but it would be my current best guess. </p>
<p>Another possibility, is that there may be a way to hook into the existing ajax calls to return our own queries. This may be easier to do, but it would be more messy and difficult to maintain in the future.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Claire		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49152</link>

		<dc:creator><![CDATA[Claire]]></dc:creator>
		<pubDate>Fri, 04 Jan 2013 07:00:05 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-49152</guid>

					<description><![CDATA[Ooops... That meant to say: select class=&quot;attachment-filters&quot; -part - forgot to remove the brackets = )]]></description>
			<content:encoded><![CDATA[<p>Ooops&#8230; That meant to say: select class=&#8221;attachment-filters&#8221; -part &#8211; forgot to remove the brackets = )</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Claire		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-49151</link>

		<dc:creator><![CDATA[Claire]]></dc:creator>
		<pubDate>Fri, 04 Jan 2013 06:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-49151</guid>

					<description><![CDATA[Great tutorial - you have a very nice and understandable way of explaining things :)

I do have a question that I hope you&#039;ll consider:
I&#039;ve been searching for a couple of days now, for a way to filter the library view (in WP 3.5) to ONLY display media from the user (even when editor) but all snippets I&#039;ve found fail for some reason. SO... Figured that if one can filter the library view from the dropdown, so only &quot;media uploaded for this post&quot; is displaying by default and nothing else, that it might do the trick. 

Is this even possible - and if yes, do you know how?

Basically what I mean is from (when using firebug) the:  .media-toolbar-secondary in the pop-up menu, then  -part, to only display the  (and thereby only the connected media to the specific post) and none of the rest from the dropdown?
Preferably for both editors and ordinary users alike, otherwise just for all, even admins if easier.

 I would so much appreciate your help on this as I&#039;m getting close to losing my mind :)]]></description>
			<content:encoded><![CDATA[<p>Great tutorial &#8211; you have a very nice and understandable way of explaining things 🙂</p>
<p>I do have a question that I hope you&#8217;ll consider:<br />
I&#8217;ve been searching for a couple of days now, for a way to filter the library view (in WP 3.5) to ONLY display media from the user (even when editor) but all snippets I&#8217;ve found fail for some reason. SO&#8230; Figured that if one can filter the library view from the dropdown, so only &#8220;media uploaded for this post&#8221; is displaying by default and nothing else, that it might do the trick. </p>
<p>Is this even possible &#8211; and if yes, do you know how?</p>
<p>Basically what I mean is from (when using firebug) the:  .media-toolbar-secondary in the pop-up menu, then  -part, to only display the  (and thereby only the connected media to the specific post) and none of the rest from the dropdown?<br />
Preferably for both editors and ordinary users alike, otherwise just for all, even admins if easier.</p>
<p> I would so much appreciate your help on this as I&#8217;m getting close to losing my mind 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aezaz		</title>
		<link>https://shibashake.com/wp/how-to-hook-into-the-media-upload-popup-interface/comment-page-1#comment-35340</link>

		<dc:creator><![CDATA[Aezaz]]></dc:creator>
		<pubDate>Fri, 02 Nov 2012 06:45:43 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=10447#comment-35340</guid>

					<description><![CDATA[Nice tutorial. good job. found what actually i want. Thanks. :)]]></description>
			<content:encoded><![CDATA[<p>Nice tutorial. good job. found what actually i want. Thanks. 🙂</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 11/23 objects using disk
Page Caching using disk: enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: cdn.shibashake.com
Lazy Loading (feed)
Minified using disk
Database Caching using disk (Request-wide modification query)

Served from: www.shibashake.com @ 2024-12-17 18:59:27 by W3 Total Cache
-->