Thread Starter
diegpl
(@diegpl)
Like, how can I set just a specif blog id to be shared on this code? Or should I change another peace of it? Tks!
function __construct() {
global $blog_id;
$this->current_blog_id = $blog_id;
/* copied from depricated get_blog_list */
global $wpdb;
$blogs = $wpdb->get_results( $wpdb->prepare(“SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = ‘1’ AND archived = ‘0’ AND spam = ‘0’ AND deleted = ‘0’ ORDER BY registered DESC”, $wpdb->siteid), ARRAY_A );
$this->blogs = array();
$sort_array = array();
foreach ( (array) $blogs as $details ) {
if ( !current_user_can_for_blog( $details[‘blog_id’], ‘upload_files’) || $details[‘blog_id’] == $this->current_blog_id ) continue;
$details[‘name’] = get_blog_option( $details[‘blog_id’], ‘blogname’ );
$this->blogs[] = $details;
$sort_array[] = strtolower ( $details[‘name’] );
}
array_multisort( $sort_array, SORT_ASC, $this->blogs );
}
yhdm
(@yellowhousedesign)
This is a great suggestion. I too would like to be able to specify one install to share media from. In my case, it would be the parent install.
-
This reply was modified 8 years, 4 months ago by
yhdm.