<?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 Add the WordPress 3.5 Media Manager Interface &#8211; Part 2	</title>
	<atom:link href="https://www.shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/feed" rel="self" type="application/rss+xml" />
	<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2</link>
	<description>Adventures in WordPress</description>
	<lastBuildDate>Tue, 27 Aug 2019 01:36:44 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9</generator>
	<item>
		<title>
		By: Janine		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-3#comment-945697</link>

		<dc:creator><![CDATA[Janine]]></dc:creator>
		<pubDate>Tue, 27 Aug 2019 01:36:44 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-945697</guid>

					<description><![CDATA[Still relevant in 2019.]]></description>
			<content:encoded><![CDATA[<p>Still relevant in 2019.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ledock		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-891689</link>

		<dc:creator><![CDATA[ledock]]></dc:creator>
		<pubDate>Mon, 04 Jul 2016 14:09:15 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-891689</guid>

					<description><![CDATA[To every people who are stucked, as i was, since two days. (i use Wordpress 4.5.3)

Replace : if (!is_object($post)) return $settings;

By: if ( isset( get_current_screen()-&#062;post_type ) &#038;&#038; (get_current_screen()-&#062;post_type == &#039;YOUR POST TYPE&#039; ) ) {
				$post = get_post( $_GET[&#039;post&#039;] );
}

Explanation: If you use a custom post type like i was &#039;$post&#039; will always be a non-object and you&#039;re not gonna be able to pass the if.

---
For those who don&#039;t get how to have a shortcode string, that&#039;s simple. Juste use a basic shortcode like : [gallery ids=&quot;729,732,731,720&quot;]. The numbers are ids of attachments you want to show.

Here is my personal code. It&#039;s not gonna resolve all issues but it&#039;s easily adaptable:

$imageIdsArray = json_decode(get_post_meta($post-&#062;ID, &quot;_gallery_medias_ids&quot;, true));

// i previously saved my images using json_encode (to transform my array of // ids into a string like &#039;[729,732]&#039; in database

if( !empty( $imageIdsArray ) ) {
     $imageIds = implode($imageIdsArray, &#039; , &#039;);
     $shortcode = &#039;[gallery ids=&quot;&#039;. $imageIds .&#039;&quot;]&#039;;
     $settings[&#039;myGallery&#039;] = array(&#039;shortcode&#039; =&#062; $shortcode);
}
return $settings;

---
Finally in your .js file put:
var shortcode = wp.shortcode.next( &#039;gallery&#039;, wp.media.view.settings.myGallery.shortcode ) 

And you&#039;ll be fine :)

---
Thanks to the author ! You made the most comprehensible documentation about wp.media manipulation and i&#039;m writing this comment in 2016 (!!)]]></description>
			<content:encoded><![CDATA[<p>To every people who are stucked, as i was, since two days. (i use WordPress 4.5.3)</p>
<p>Replace : if (!is_object($post)) return $settings;</p>
<p>By: if ( isset( get_current_screen()-&gt;post_type ) &amp;&amp; (get_current_screen()-&gt;post_type == &#8216;YOUR POST TYPE&#8217; ) ) {<br />
				$post = get_post( $_GET[&#8216;post&#8217;] );<br />
}</p>
<p>Explanation: If you use a custom post type like i was &#8216;$post&#8217; will always be a non-object and you&#8217;re not gonna be able to pass the if.</p>
<p>&#8212;<br />
For those who don&#8217;t get how to have a shortcode string, that&#8217;s simple. Juste use a basic shortcode like : [gallery ids="729,732,731,720"]. The numbers are ids of attachments you want to show.</p>
<p>Here is my personal code. It&#8217;s not gonna resolve all issues but it&#8217;s easily adaptable:</p>
<p>$imageIdsArray = json_decode(get_post_meta($post-&gt;ID, &#8220;_gallery_medias_ids&#8221;, true));</p>
<p>// i previously saved my images using json_encode (to transform my array of // ids into a string like &#8216;[729,732]&#8217; in database</p>
<p>if( !empty( $imageIdsArray ) ) {<br />
     $imageIds = implode($imageIdsArray, &#8216; , &#8216;);<br />
     $shortcode = &#8216;[gallery ids="'. $imageIds .'"]&#8216;;<br />
     $settings[&#8216;myGallery&#8217;] = array(&#8216;shortcode&#8217; =&gt; $shortcode);<br />
}<br />
return $settings;</p>
<p>&#8212;<br />
Finally in your .js file put:<br />
var shortcode = wp.shortcode.next( &#8216;gallery&#8217;, wp.media.view.settings.myGallery.shortcode ) </p>
<p>And you&#8217;ll be fine 🙂</p>
<p>&#8212;<br />
Thanks to the author ! You made the most comprehensible documentation about wp.media manipulation and i&#8217;m writing this comment in 2016 (!!)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: thuan		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-1#comment-864276</link>

		<dc:creator><![CDATA[thuan]]></dc:creator>
		<pubDate>Fri, 06 Nov 2015 06:13:33 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-864276</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-1#comment-93105&quot;&gt;Phil Johnston&lt;/a&gt;.

thanks you.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-1#comment-93105">Phil Johnston</a>.</p>
<p>thanks you.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Use customize_register to Create and Extend Customization In WordPress Themes - MatthewGladney.com		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-596118</link>

		<dc:creator><![CDATA[Use customize_register to Create and Extend Customization In WordPress Themes - MatthewGladney.com]]></dc:creator>
		<pubDate>Fri, 02 Jan 2015 19:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-596118</guid>

					<description><![CDATA[[&#8230;] is a very good explainer for how to use the media manager, but I will try to simplify things a bit for our purposes [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] is a very good explainer for how to use the media manager, but I will try to simplify things a bit for our purposes [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lorenzo		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-401301</link>

		<dc:creator><![CDATA[Lorenzo]]></dc:creator>
		<pubDate>Mon, 27 Oct 2014 09:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-401301</guid>

					<description><![CDATA[Hi realy a good tutorian thank you :)
A question, I wuold like to keep the &quot;select a file&quot; button open even when there are file already loaded in the mediamanager. Is there a way to do this?
Thank you]]></description>
			<content:encoded><![CDATA[<p>Hi realy a good tutorian thank you 🙂<br />
A question, I wuold like to keep the &#8220;select a file&#8221; button open even when there are file already loaded in the mediamanager. Is there a way to do this?<br />
Thank you</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cyrus David		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-241226</link>

		<dc:creator><![CDATA[Cyrus David]]></dc:creator>
		<pubDate>Sun, 24 Aug 2014 05:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-241226</guid>

					<description><![CDATA[Hi, I got lost at this part:

&lt;code&gt;// Create our own shortcode string here
    $shortcode = ...&lt;/code&gt;

How do I generate the shortcode?]]></description>
			<content:encoded><![CDATA[<p>Hi, I got lost at this part:</p>
<p><code>// Create our own shortcode string here<br />
    $shortcode = ...</code></p>
<p>How do I generate the shortcode?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: bean		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-199540</link>

		<dc:creator><![CDATA[bean]]></dc:creator>
		<pubDate>Tue, 22 Jul 2014 01:43:20 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-199540</guid>

					<description><![CDATA[Nice tutorial ShibaShake. 

I&#039;m stuck with this:
wp.media.post( &#039;shiba-mlib-gallery-update&#039;, {
        nonce:      wp.media.view.settings.post.nonce, 
        html:       wp.media.shibaMlibEditGallery.link,
        post_id:    wp.media.view.settings.post.id,
        ids:        ids
    }).done( function() {
        window.location = wp.media.shibaMlibEditGallery.link;
    });

and this:
add_action( &#039;wp_ajax_shiba-mlib-gallery-update&#039;, 
           array($this,&#039;wp_ajax_shiba_mlib_gallery_update&#039;));

wp.media.shibaMlibEditGallery.link returns undefined. 

Do you mind giving an example setting of wp.media.shibaMlibEditGallery.link and implementation of wp_ajax_shiba_mlib_gallery_update. 

I really appreciate it so much. Thanks again :)]]></description>
			<content:encoded><![CDATA[<p>Nice tutorial ShibaShake. </p>
<p>I&#8217;m stuck with this:<br />
wp.media.post( &#8216;shiba-mlib-gallery-update&#8217;, {<br />
        nonce:      wp.media.view.settings.post.nonce,<br />
        html:       wp.media.shibaMlibEditGallery.link,<br />
        post_id:    wp.media.view.settings.post.id,<br />
        ids:        ids<br />
    }).done( function() {<br />
        window.location = wp.media.shibaMlibEditGallery.link;<br />
    });</p>
<p>and this:<br />
add_action( &#8216;wp_ajax_shiba-mlib-gallery-update&#8217;,<br />
           array($this,&#8217;wp_ajax_shiba_mlib_gallery_update&#8217;));</p>
<p>wp.media.shibaMlibEditGallery.link returns undefined. </p>
<p>Do you mind giving an example setting of wp.media.shibaMlibEditGallery.link and implementation of wp_ajax_shiba_mlib_gallery_update. </p>
<p>I really appreciate it so much. Thanks again 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jeremy		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-185298</link>

		<dc:creator><![CDATA[Jeremy]]></dc:creator>
		<pubDate>Tue, 08 Jul 2014 17:05:19 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-185298</guid>

					<description><![CDATA[Nice tutorial, thanks. Helped me fix an issue in my plugin. ;)]]></description>
			<content:encoded><![CDATA[<p>Nice tutorial, thanks. Helped me fix an issue in my plugin. 😉</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lukas Doubek		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-94654</link>

		<dc:creator><![CDATA[Lukas Doubek]]></dc:creator>
		<pubDate>Wed, 05 Feb 2014 13:25:45 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-94654</guid>

					<description><![CDATA[Hi, nice article, im running the media uploader window from a colorbox modal window, which i set to 90%width, and inside i have button which trigger the media uploader.
but when i trigger it, it everytime opens smaller than the parent colorbox modal.
where can i set the width and height for the window with media uploader?
thanks for reply.]]></description>
			<content:encoded><![CDATA[<p>Hi, nice article, im running the media uploader window from a colorbox modal window, which i set to 90%width, and inside i have button which trigger the media uploader.<br />
but when i trigger it, it everytime opens smaller than the parent colorbox modal.<br />
where can i set the width and height for the window with media uploader?<br />
thanks for reply.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sascha		</title>
		<link>https://shibashake.com/wp/how-to-add-the-wordpress-3-5-media-manager-interface-part-2/comment-page-2#comment-93606</link>

		<dc:creator><![CDATA[Sascha]]></dc:creator>
		<pubDate>Tue, 31 Dec 2013 03:02:05 +0000</pubDate>
		<guid isPermaLink="false">http://shibashake.com/wordpress-theme/?p=11347#comment-93606</guid>

					<description><![CDATA[Hi there,

I do not properly understand the 2nd part (2. Get Initial Gallery Images) at all. I am not using your plugin/theme, but want to use the code on the front end. I mastered step 1 ok - so I get the media modal, but there are no proper explanations for step 2. I would like to only show the uploaded images to the post that is just being viewed. Is there a good way to do this? Apart from that the explanations are very detailed and very helpful!
Thanks,
Sascha]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>I do not properly understand the 2nd part (2. Get Initial Gallery Images) at all. I am not using your plugin/theme, but want to use the code on the front end. I mastered step 1 ok &#8211; so I get the media modal, but there are no proper explanations for step 2. I would like to only show the uploaded images to the post that is just being viewed. Is there a good way to do this? Apart from that the explanations are very detailed and very helpful!<br />
Thanks,<br />
Sascha</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 10/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 2/33 queries in 0.013 seconds using disk (Request-wide modification query)

Served from: www.shibashake.com @ 2024-12-15 14:53:10 by W3 Total Cache
-->