/** * Renders the MLA Gallery in meta box on the Edit Media page. * Declared public because it is a callback function. * * @since 0.80 * * @param object current post * * @return void echoes the HTML markup for the meta box content */ public static function mla_mla_gallery_in_handler($post) { if (is_null(self::$mla_references)) { self::$mla_references = MLAQuery::mla_fetch_attachment_references($post->ID, $post->post_parent); } $galleries = ''; if (is_array(self::$mla_references)) { foreach (self::$mla_references['mla_galleries'] as $gallery_id => $gallery) { if ($gallery_id == $post->post_parent) { $parent = __('PARENT', 'media-library-assistant') . ' '; } else { $parent = ''; } $galleries .= sprintf('%1$s (%2$s %3$s), %4$s', $parent, $gallery['post_type'], $gallery_id, $gallery['post_title']) . "\n"; } // foreach $feature } $galleries = apply_filters('mla_mla_gallery_in_meta_box', array('galleries' => $galleries, 'rows' => 5, 'cols' => 80), self::$mla_references, $post); $html = '<label class="screen-reader-text" for="mla_mla_gallery_in">' . __('MLA Gallery in', 'media-library-assistant') . '</label><textarea class="readonly" id="mla_mla_gallery_in" rows="' . absint($galleries['rows']) . '" cols="' . absint($galleries['cols']) . '" readonly="readonly" name="mla_mla_gallery_in" >' . esc_textarea($galleries['galleries']) . "</textarea>\n"; echo apply_filters('mla_mla_gallery_in_meta_box_html', $html, $galleries, self::$mla_references, $post); }
/** * Renders the Gallery in meta box on the Edit Media page. * Declared public because it is a callback function. * * @since 0.80 * * @param object current post * * @return void echoes the HTML markup for the meta box content */ public static function mla_mla_gallery_in_handler($post) { if (is_null(self::$mla_references)) { self::$mla_references = MLAData::mla_fetch_attachment_references($post->ID, $post->post_parent); } $galleries = ''; if (is_array(self::$mla_references)) { foreach (self::$mla_references['mla_galleries'] as $gallery_id => $gallery) { if ($gallery_id == $post->post_parent) { $parent = 'PARENT '; } else { $parent = ''; } $galleries .= sprintf('%1$s (%2$s %3$s), %4$s', $parent, $gallery['post_type'], $gallery_id, $gallery['post_title']) . "\r\n"; } // foreach $feature } echo '<label class="screen-reader-text" for="mla_mla_gallery_in">MLA Gallery in</label><textarea class="readonly" id="mla_mla_gallery_in" rows="5" cols="80" readonly="readonly" name="mla_mla_gallery_in" >' . esc_textarea($galleries) . "</textarea>\r\n"; }