WordPress.org

Ready to get started?Download WordPress

Forums

Image attribute "title" being stripped from posts. (3 posts)

  1. john-michael
    Member
    Posted 3 years ago #

    Anyone know why wp_update_post() would strip title="" image attribute from posts?

    I have a cron script that updates $my_post['post_date'] & $my_post['post_date_gmt']

    And for some reason the wp_updat_post() strips the title img attribute from my posts.

    Any help is appreciated.

  2. john-michael
    Member
    Posted 3 years ago #

    I've tested it through and through. I've narrowed it down to the following fucntion. When I comment that fucntion out, the title attribute isn't stripped. Here's the code that I can comment out and avoid said issue.

    $my_post = array();
      $my_post['ID'] = $post_id_to_update;
      $my_post['post_date'] = $tdate;
      $my_post['post_date_gmt'] = $tgmdate;
    wp_update_post( $my_post );

    And when I say "stripped" the entire attribute is removed. For example...

    Before function...

    <img src="http://domain.com/image.jpg" alt="alt message about image" title="image title" width="461" height="450" class="alignnone size-full wp-image-4383" />

    After function...

    <img src="http://domain.com/image.jpg" alt="alt message about image" width="461" height="450" class="alignnone size-full wp-image-4383" />
  3. anup
    Member
    Posted 3 years ago #

    I find similar thing on my site. The title attribute gets stripped from images.

    http://indiapoint.net/fb/

Topic Closed

This topic has been closed to new replies.

About this Topic