klihelp
Forum Replies Created
-
In Media Library / Unattached section I can delete all broken attachments …
1. but have to be careful to not delete eg the header image which the template uses, but marked as unattached
2. maybe there are other unattached images as well, selection will take a whileUsing plugin v.0.1.2 this is an issue when you have manual folder ordering option.
Looks like only main folders are trashed. Child folders are not trashed. This will give you the message when you try to empty the trash.
Unless changing the ordering option something else than manual.
… but child folders are not visible anywhere, because the parent folder already trashed.– There is an error when you try to empty/delete the folders in the Trash.
You cannot delete a parent folderThis is because the plugin only deletes the main folder post and not the descendant posts.
Maybe you are right … this is your plugin and you design the way you want:)
Here is the code to not show Eazyest Gallery items in Media Popup for other post types.
ps: looks like the plugin already doing something similar, because only sharing the gallery images with the POST custom post type.
/** Exclude Eazyest Gallery from Media Popup when not in folders * */ function kli_ezg_mediapopup_exclude() { if ( ! eazyest_folderbase()->refered_by_folder() ) add_filter( 'posts_where_paged', 'kli_ezg_medialibrary_exclude_wp_query', 1 ); } add_action( 'wp_ajax_query-attachments', 'kli_ezg_mediapopup_exclude', 1 );From here, it would be easy to create an isolation option.
I managed to isolate the gallery images from the Media Library using a wordpress core filter.
(using WordPress 3.5.1, plugin version 0.1.2)See the code bellow. Can you help me to point out how can I isolate the folder images from the insert media popup box?
I’m new in that one, and I’m sure without help I can figure out in a few days, but though you could give me some hints.// Isolate gallery images from Media Library if ( is_admin() && is_plugin_active('eazyest-gallery/eazyest-gallery.php') ) { /**kli map wp * Count number of attachments for the mime type(s). * * If you set the optional mime_type parameter, then an array will still be * returned, but will only have the item you are looking for. It does not give * you the number of attachments that are children of a post. You can get that * by counting the number of children that post has. * * @since 2.5.0 * * @param string|array $mime_type Optional. Array or comma-separated list of MIME patterns. * @return array Number of posts for each mime type. */ function kli_ezg_wp_count_attachments( $mime_type = '' ) { global $wpdb; $and = wp_post_mime_type_where( $mime_type ); /*kli * Exclude some media items * - append to $and */ $attachment_base_url = eazyest_gallery()->address(); $and .= " AND $wpdb->posts.guid NOT LIKE '{$attachment_base_url}%'"; $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A ); $stats = array(); foreach( (array) $count as $row ) { $stats[$row['post_mime_type']] = $row['num_posts']; } $stats['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and"); return (object) $stats; } /**kli map wp * Display the list of views available on this table. * * @since 3.1.0 * @access public */ function kli_ezg_get_views() { global $wpdb, $post_mime_types, $avail_post_mime_types; $type_links = array(); $_num_posts = (array) kli_ezg_wp_count_attachments(); $_total_posts = array_sum($_num_posts) - $_num_posts['trash']; if ( !isset( $total_orphans ) ) $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" ); $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts)); foreach ( $matches as $type => $reals ) foreach ( $reals as $real ) $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real]; //*kli map $this_detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] ); // $class = ( empty($_GET['post_mime_type']) && !$this->detached && !isset($_GET['status']) ) ? ' class="current"' : ''; $class = ( empty($_GET['post_mime_type']) && !$this_detached && !isset($_GET['status']) ) ? ' class="current"' : ''; $type_links['all'] = "<a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>'; foreach ( $post_mime_types as $mime_type => $label ) { $class = ''; if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) ) continue; if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) ) $class = ' class="current"'; if ( !empty( $num_posts[$mime_type] ) ) $type_links[$mime_type] = "<a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>'; } $type_links['detached'] = '<a href="upload.php?detached=1"' . ( $this_detached ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>'; if ( !empty($_num_posts['trash']) ) $type_links['trash'] = '<a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>'; return $type_links; } // Update wp_query for Media Library // - in kli_ezg_medialibrary_exclude function kli_ezg_medialibrary_exclude_wp_query( $content ) { global $wpdb; $attachment_base_url = eazyest_gallery()->address(); $content .= " AND $wpdb->posts.guid NOT LIKE '{$attachment_base_url}%'"; return $content; } // Exclude some media items from Media Library function kli_ezg_medialibrary_exclude( $input ) { add_filter( 'posts_where_paged', 'kli_ezg_medialibrary_exclude_wp_query' ); add_filter( 'views_upload', 'kli_ezg_get_views' ); return $input; } add_filter( 'upload_per_page', 'kli_ezg_medialibrary_exclude' ); }// if plugin activeThanks for the reasoning.
Deleting a folder in FTP is intentional, similarly as uploading folders in FTP.The Media Library shows the broken attachments for the trashed folders. Is there any way to fix this?
Forum: Plugins
In reply to: [Eazyest Gallery] How to delete pictures name?The plugin, Eazyest Gallery, using the built-in [gallery] shortcode output, so there is no template.
You can get the code from the wordpress gallery_shortcode function, modify to remove the media caption.
http://core.trac.wordpress.org/browser/branches/3.5/wp-includes/media.php#L661Maybe comment this line as well, to make sure other plugins will not change the gallery output:
// Allow plugins/themes to override the default gallery template.
$output = apply_filters(‘post_gallery’, ”, $attr);Forum: Plugins
In reply to: [Eazyest Gallery] How to delete pictures name?In your template functions you have to overwrite the [gallery] shortcode output.
Something like this:
add_filter("post_gallery", "my_gallery_output",10,2); function my_gallery_output($output, $attr) { // modify the original gallery output here ... }Deleting folders on FTP has the same problem.
The associated folder post will be trashed.
But
– there is no way to restore from the trash
– media library full of broken images, and you have to spend a lot of time to cleanup the media sectionI’m hopeful this will change in the future, because it’s not a good way to leave that mess in the Media Library after deactivating the plugin.
This is a fact feedback, not a complain:)
Sorry if you see differently. Some people will not take any effort to submit an issue, suggestions, improvements … and they move on. But I’m still here and try to help you.
regardsForum: Plugins
In reply to: [Eazyest Gallery] Subfolders title on front-endThanks, works well.
The setup is based on this setting:
https://github.com/markjaquith/WordPress-SkeletonThanks, now images are displayed correctly on WordPress subfolder install with custom /wp-content/ outside the /wp/ subfolder.
Both URLs are the same. WordPress Address (URL) : localhost.com/_test/website Site Address (URL) : localhost.com/_test/website