wesg
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WP3.4 losing photo dataLike my response in this other post, I discovered that the reason the files are missing is because WP 3.4 now requires the _wp_attached_file meta key. That post includes PHP code for processing the attachments in the database and updating this key accordingly.
Forum: Plugins
In reply to: [Plugin: Regenerate Thumbnails] Stopped working, error msgI discovered why the icons aren’t showing up. It appears that previous versions of WP ignored the _wp_attached_file meta key, where the newest version requires it for looking up the attachment data. The attachments that weren’t displaying were missing this key.
Below is PHP code for descending through the post database, verifying the presence of this key (and file) and updating accordingly. I’ll leave it to you to add it to your theme (I added it to a submenu for database tools). After processing, it will display the number of updates, skipped posts and errors.
// descend through the database $updated = 0; $skipped = 0; $error = 0; $upload_dir = wp_upload_dir(); $sql = sprintf("select * from %s where post_type = 'attachment'", $wpdb->posts); $all_attachments = $wpdb->get_results($sql); foreach ($all_attachments as $attachment) { // get the meta value $meta = get_post_meta($attachment->ID, "_wp_attachment_metadata", true); $file = $meta['file']; // verify that the file exists $file_path = $upload_dir['basedir'] . '/' . $file; if (!file_exists($file_path)) { $error++; } else { // add the meta value, which returns false if it already exists $adding_meta = add_post_meta($attachment->ID, '_wp_attached_file', $file, true); if ($adding_meta) $updated++; else $skipped++; } } echo '<div id="message" class="updated"><p>' . sprintf("%d attachments were updated, %d were skipped and %d had errors.", $updated, $skipped, $error) . '</p></div>';
Forum: Plugins
In reply to: [Plugin: Regenerate Thumbnails] Stopped working, error msgI’d like to add that I just just tried the above var_dump command on specific attachments and the images that disappeared return a blank string.
Forum: Plugins
In reply to: [Plugin: Regenerate Thumbnails] Stopped working, error msgI’m having the same issue with media thumbnails, but I’m doubtful it’s related to the plugin. Since updating to WP3.4 most of my older media is not showing up and trying this plugin results in the same error as above.
I’m guessing something changed from the database retrieval. If you need any help debugging, I’d be happy to help!
Forum: Plugins
In reply to: add_menu_page without root outputAnswer was found on the Administration Menu wiki
In situations where a plugin is creating its own top-level menu, the first submenu will normally have the same link title as the top-level menu and hence the link will be duplicated. The duplicate link title can be avoided by calling the add_submenu_page function the first time with the parent_slug and menu_slug parameters being given the same value.
So essentially the add_submenu_page parameters are:
add_submenu_page('root_page_slug', 'Page Title', 'Menu Title', 'administrator', 'root_page_slug', 'submenu_page_slug');
Forum: Fixing WordPress
In reply to: Most popular posts widget not workingHi,
please try downloading and installing version 1.5 of this plugin, and tell me if it doesn’t work properly still.Forum: Plugins
In reply to: [Plugin: Most Popular Posts] widget standardsThank you for the kind words about the plugin! I have rewritten the plugin to version 1.5 so that it now conforms to WP3.0 standards. The before, after_widget settings are there, as well as the list structure. Please try it and tell me if you still have the same problems as before.
Forum: Plugins
In reply to: Default options in a widgetNevermind, solved it.
Declare a global array at the top of the file with default values.
Inside the form and output function, check if the option array is empty, then sub in the defaults if it is.
Forum: Plugins
In reply to: Function to mark new lines as paragraphs?Nevermind, I solved my problem.
For the record, use the function wpautop($content); to return formatted text.
Forum: Fixing WordPress
In reply to: running a function on theme activation in functions.phpI know this post is very old, but I was looking for a similar thing. It seems that the hook
register_activation_hook( __FILE__, 'function');
does not work for themes. Is there an alternative?Forum: Fixing WordPress
In reply to: Most popular postsHi, I wrote the Most Popular Posts plugin and it might help you. It provides a list of top commented posts in your sidebar and can be customized to suit any style or situation.
https://www.ads-software.com/extend/plugins/most-popular-posts/
Forum: Plugins
In reply to: [Plugin: Most Popular Posts] Pluging not picking up all postsHi, I wrote the Most Popular Posts plugin and would like to help you. Could you provide some more information? Plugin version, WordPress version, etc?
Forum: Fixing WordPress
In reply to: How to bulk load posts ?Hi, I made a plugin that allows users to import files that use the CSV format. With a properly set up file, you can import dozens, or even hundreds of pages into categories you’ve set up.
https://www.wesg.ca/2008/06/wordpress-plugin-mass-page-maker/
Forum: Fixing WordPress
In reply to: Creating pages “in bulk”….. is it possible?Hi thiskey, I also created a plugin to do this type of thing. Have a look at https://www.ads-software.com/extend/plugins/mass-page-maker/ and it might be what you’re looking for.
Forum: Fixing WordPress
In reply to: how to upload multiple posts & assign them to categories?Hi this thread has been inactive for 2 months, but I’d like to add that I have just added a CSV feature to my plugin called Mass Page Maker.
https://www.wesg.ca/2008/06/wordpress-plugin-mass-page-maker/
With it, you can insert pages using a CSV and assign each individual post to which category you desire.