WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Importer
[resolved] Image titles not restored in posts (4 posts)

  1. lexy2345
    Member
    Posted 3 years ago #

    After importing the image titles <img title="..."> are missing in posts. However the titles are present in the media library.

    In the imported WXR file (created in WP 3.1.2) the image titles are present in the posts texts.

  2. Jon Cave
    WordPress Dev
    Plugin Author

    Posted 3 years ago #

    Are the image tags completely missing or are the contents of the title attributes missing? Or something else completely?

    If you switch to HTML view in the editor on a post which is supposed to have an image what does the HTML img tag look like if it's there? What exactly is wrong about it, some examples of before and after import.

  3. lexy2345
    Member
    Posted 3 years ago #

    Other tags are correct. Everything else looks good. Here are the examples.

    SOURCE BLOG

    [caption id="attachment_1658" align="alignleft" width="150" caption="Anschluss an Regenfallrohr mit Speedy"]<a href="http://www.source.de/wp-content/uploads/2011/04/PICT1865_800x600.jpg"><img class="size-thumbnail wp-image-1658 " title="Anschluss an Regenfallrohr mit dem Speedy Regensammler" src="http://www.source.de/wp-content/uploads/2011/04/PICT1865_800x600-150x150.jpg" alt="Anschluss an Regenfallrohr mit dem Speedy Regensammler" width="150" height="150" /></a>[/caption]

    TARGET BLOG (after import)

    [caption id="attachment_1658" align="alignleft" width="150" caption="Anschluss an Regenfallrohr mit Speedy"]<a href="http://www.target.de/baublog/files/2011/04/PICT1865_800x600.jpg"><img class="size-thumbnail wp-image-1658 " src="http://www.target.de/baublog/files/2011/04/PICT1865_800x600-150x150.jpg" alt="Anschluss an Regenfallrohr mit dem Speedy Regensammler" width="150" height="150" /></a>[/caption]

  4. lexy2345
    Member
    Posted 3 years ago #

    After some debugging I found the solution. In wp-includes/kses.php I allowed title as attribute on image tag. Now the title tag doesn't disappear after import.

    'img' => array(
    			'alt' => array (),
    			'align' => array (),
    			'border' => array (),
    			'class' => array (),
    			'height' => array (),
    			'hspace' => array (),
    			'longdesc' => array (),
    			'vspace' => array (),
    			'src' => array (),
    			'style' => array (),
    			'title' => array (),
    			'width' => array ()),

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic