Title: peterbra's Replies | WordPress.org

---

# peterbra

  [  ](https://wordpress.org/support/users/peterbra/)

 *   [Profile](https://wordpress.org/support/users/peterbra/)
 *   [Topics Started](https://wordpress.org/support/users/peterbra/topics/)
 *   [Replies Created](https://wordpress.org/support/users/peterbra/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/peterbra/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/peterbra/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/peterbra/engagements/)
 *   [Favorites](https://wordpress.org/support/users/peterbra/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/users/peterbra/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/peterbra/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/peterbra/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[qTranslate X] Language switcher disappear on Custom post EDIT](https://wordpress.org/support/topic/language-switcher-disappear-on-custom-post-edit/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/language-switcher-disappear-on-custom-post-edit/#post-6095148)
 * Please delete this – this was my fault as I’ve placed some admin JS which was
   causing problems ! All is OK with the plugin 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Custom Post Order] Plugin is BROKEN for WP 4.1, breaks Media Library](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/)
 *  [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/#post-5690571)
 * Well bro – if you are good with PHP – check in mysql and see how it’s storing
   data and try to manipulate it (I don’t have time to play with it now), and then
   find you own fix for that – I never worked with that plugin as I think that it’s
   always best to use native WP stuff and just manually modify them through functions(
   you know what you did so it’s easy to update in some point of time if needed 
   + relying on plugin can be fuzzy e.g. plugin author stops updating it and after
   5-6 WP updates it breaks so does the whole site).
 * Good luck with that bro !
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Custom Post Order] Plugin is BROKEN for WP 4.1, breaks Media Library](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/)
 *  [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/#post-5690569)
 * You should see what kind of post is that and just exclude it from mysql query(
   so it’s never processed). It should be easy fix, but of-course, with every plugin
   update – you will have to add that post-type as an exclusion 🙂
 * If it’s creating it’s own db tables – it’s going to be slightly more complicated,
   but definitely doable.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Custom Post Order] Plugin is BROKEN for WP 4.1, breaks Media Library](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/)
 *  [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/#post-5690560)
 * OK, I needed this fast so I just did quick’n’dirty hack so it won’t include attachments
   in SCPO Here is solution (I hope author will include in next update so we don’t
   have to do it every time):
    In plugin directory edit file simple-custom-post-
   order.php locate line 148 (it should be inside refresh function) and current 
   line is like this:
 * `$results = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type 
   = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private','
   future') ORDER BY menu_order ASC" );`
 * Now EXCLUDE attachment page from being queried and replace that line with this
   line:
 * `$results = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type 
   = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private','
   future') AND post_type != 'attachment' ORDER BY menu_order ASC" );`
 * NOTE: only thing changed here is `AND post_type != 'attachment'`
 * Everything should work OK now.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Custom Post Order] Plugin is BROKEN for WP 4.1, breaks Media Library](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/)
 *  [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-is-broken-for-wp-41-breaks-media-library/#post-5690559)
 * I second this issue – on vanilla WP install with SCPO plugin you CAN’T order 
   the gallery images properly. I am pretty much sure that it’s because plugin doesn’t
   have an option to exclude media type attachment from sorting – I will try to 
   find solution later today….
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [How to add fields to Gallery Settings?](https://wordpress.org/support/topic/how-to-add-fields-to-gallery-settings/)
 *  [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/how-to-add-fields-to-gallery-settings/#post-4084886)
 * Place this code in your functions:
 *     ```
       add_action('print_media_templates', function(){
   
         // define your backbone template;
         // the "tmpl-" prefix is required,
         // and your input field should have a data-setting attribute
         // matching the shortcode name
         ?>
         <script type="text/html" id="tmpl-my-custom-gallery-setting">
           <label class="setting">
             <span><?php _e('My setting'); ?></span>
             <select data-setting="my_custom_attr">
               <option value="foo"> Foo </option>
               <option value="bar"> Bar </option>
               <option value="default_val"> Default Value </option>
             </select>
           </label>
         </script>
   
         <script>
   
           jQuery(document).ready(function(){
   
             // add your shortcode attribute and its default value to the
             // gallery settings list; $.extend should work as well...
             _.extend(wp.media.gallery.defaults, {
               my_custom_attr: 'default_val'
             });
   
             // merge default gallery settings template with yours
             wp.media.view.Settings.Gallery = wp.media.view.Settings.Gallery.extend({
               template: function(view){
                 return wp.media.template('gallery-settings')(view)
                      + wp.media.template('my-custom-gallery-setting')(view);
               }
             });
   
           });
   
         </script>
         <?php
   
       });
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP TinyMCE set custom font size in pixels](https://wordpress.org/support/topic/wp-tinymce-set-custom-font-size-in-pixels/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wp-tinymce-set-custom-font-size-in-pixels/#post-4408071)
 * Ok, for all of you searching for a solution here it goes:
 *     ```
       function wwiz_mce_inits($initArray){
           $initArray['height'] = '600px';
           $initArray['theme_advanced_font_sizes'] = '10px,12px,13px,14px,15px,16px,18px,20px,22px,24px,26px,28px,30px,32px,34px,36px,38px,40px';
           $initArray['font_size_style_values'] = '10px,12px,13px,14px,15px,16px,18px,20px,22px,24px,26px,28px,30px,32px,34px,36px,38px,40px';
           return $initArray;
       }
       add_filter('tiny_mce_before_init', 'wwiz_mce_inits');
       ```
   
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Media Uploader issue](https://wordpress.org/support/topic/media-uploader-issue-3/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/media-uploader-issue-3/#post-4375941)
 * Hi Ipstenu and thanks for your time helping me out, but my users are mostly elderly
   people or people with no computer experience what-so-ever, and I really have 
   to make this system easy to use.
 * I did more than 100 WP sites – never did the MU – this is my first one so I know
   that there are a lot of plugins and I can use roles and stuff – I know all that,
   but this is the road i have to go – my custom backend on main site, and I am 
   almost done 🙂
 * I am kind of baffled that there is no work-around to solve ajax cross-domain 
   media-uploader issue.
 * Once again thanks for your time and effort – I appreciate it 🙂
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Media Uploader issue](https://wordpress.org/support/topic/media-uploader-issue-3/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/media-uploader-issue-3/#post-4375935)
 * Well, I wouldn’t be bothering my self to do something if I don’t have to, right
   🙂
 * The goal is that all admins will go to one page on my main domain and manage 
   their respective sites from there. They won’t have that many options as they 
   have in WP – only basics one like: write page/post and delete/edit, create category
   and upload media to the post, change profile info and that’s about it.
 * Anyway – I couldn’t find the right solution for this, so I’ll just write my own
   media uploader…
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Media Uploader issue](https://wordpress.org/support/topic/media-uploader-issue-3/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/media-uploader-issue-3/#post-4375832)
 * Well – I’m not sure what’s best to do as I’m new to WP MU – can you point me 
   in right direction now ? What should I do to make this uploader work with setup
   I have… How do I alter cross-domain policy ?
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Media Uploader issue](https://wordpress.org/support/topic/media-uploader-issue-3/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/media-uploader-issue-3/#post-4375830)
 * Well, that’s the thing I’m confused with – all users (and user is blog admin 
   as I have only one user per blog and that user is blog admin), so all admins 
   are also logging via [http://www.MainDomain.com/login](http://www.MainDomain.com/login)
   and all cookies are set there.
 * I know all cookies are good because after login on main site I can go to subdomain.
   MainDomain.com/wp-admin and I am logged-in as admin, and from there I can use
   wp normally ( wp uploader as well 🙂 )
 * Only issue I have is with media uploader on main blog (MainDomain.com/members
   is location) -> how to “explain” to that ajax call that user is admin and that
   he is logged in and that all is OK as it seems to me that ajax can’t figure out
   that user is legit – hence it’s denying access 🙁
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Media Uploader issue](https://wordpress.org/support/topic/media-uploader-issue-3/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/media-uploader-issue-3/#post-4375828)
 * OK, I see your point 🙂 Do you have any ideas why ajax isn’t authenticating requests?
 * My wild guess is that it’s ajax/same domain policy issue ? I am doing switch_to_blog()
   call and that part is ok (like post/page are updating etc…), but since that call
   is coming from [http://www.MainDomain.com/members](http://www.MainDomain.com/members)
   and is trying to upload to blog.MainDomain.com I guess that in that part the 
   conflict occurs (for ajax [http://www.MainDomain.com](http://www.MainDomain.com)
   and blog.MainDomain.com are completely different domains) – am I right ?
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Media Uploader issue](https://wordpress.org/support/topic/media-uploader-issue-3/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/media-uploader-issue-3/#post-4375814)
 * They are editing their own pages/posts (mine setup is only one username/admin
   per blog).It’s subdomain setup, so I guess it may be some kind of domain policy
   issue when they have to upload from “main domain” members page ? I am not sure
   if switch_to_blog($userblog_id) is working properly when ajax calls are running?
   And i’m not that good in Ajax 🙁
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Media Uploader issue](https://wordpress.org/support/topic/media-uploader-issue-3/)
 *  Thread Starter [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/media-uploader-issue-3/#post-4375652)
 * ..Forgot to mention when I go to the site dashboard for that blog and click Add
   media button – admin-ajax.php response is :
    {“wp-auth-check”:true,”wp-refresh-
   post-lock”:{“new_lock”:”1386087028:4″},”server_time”:1386087028}
 * So obviously even if I am logged in as blog admin on main site – I am not getting
   authenticated as blog admin when ajax request is run on MainDomain.com ? Is there
   a work-around ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [wp_editor throwing js error "wp.media.view.settings.post is undefined"](https://wordpress.org/support/topic/wp_editor-throwing-js-error-wpmediaviewsettingspost-is-undefined/)
 *  [peterbra](https://wordpress.org/support/users/peterbra/)
 * (@peterbra)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wp_editor-throwing-js-error-wpmediaviewsettingspost-is-undefined/#post-4004152)
 * I am having issues with WP MU … It keeps telling me “An error occurred in the
   upload. Please try again later.”… on a upload media pop-up (once a file is uploaded
   and supposed to be saved)
 * Setup is: All sub-blog admins are going to [http://www.MainDomain.com/members](http://www.MainDomain.com/members)
   page and on that page I’ve managed to put wp_editor…. I am loading all admin 
   scripts on that page and I am using switch_to_blog($userblog_id); but error still
   shows… no errors thrown in server log… any ideas ?

Viewing 15 replies - 1 through 15 (of 32 total)

1 [2](https://wordpress.org/support/users/peterbra/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/peterbra/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/peterbra/replies/page/2/?output_format=md)