1

When saving a post with the title Jule's Gormet, it gets formatted as Jule's Gormet. If I save it again, it becomes Jule's Gormet.

Following this pattern, it keeps escaping the ampersand and getting worse.

More info

  • WordPress version: 3.3.2
  • Theme: http://themetrust.com's Reveal (heavily modified)
  • DB is UTF-8
  • settings>reading has encoding set to UTF-8
  • values are being stored in the database as Jule's (etc..)

I've disabled all plugins and the problem persists.
I've gone through functions.php pretty well, and didn't find anything suspicious. I followed the troubleshooting guide in the brasofilo's comment - but to no effect. Any ideas?

Added this code per tommix

function get_post_title($title) { 
    wp_mail('[email protected]','the title',$title); return $title; 
} add_filter ('title_save_pre','get_post_title');  

Which Yielded these results:

  • Jule\'s Gormet - 1st attempt save
  • Jule's Gormet - 2nd attempt save
  • Jule's Gormet - 3rd attempt save
  • Jule's Gormet - 4th attempt save

It actually sent 2 emails per save operation - maybe it means something? idk.

On the Trail!

so, I bit the bullet and started in on a fresh install - using all the edited theme code. After liberally deleting stuff from the functions.php, I found the issue is somehow related to Bainternet's Tax-meta-class I'm using to add a field to one of my custom taxonomies. Removing the following code fixes the issue. (though I'd like to figure out how to fix it while retaining my added taxonomy field.

// CUSTOM TAXONOMY FIELDS
require_once("Tax-meta-class/Tax-meta-class.php");
$config = array(
   'id' => 'focus_creative_services',
   'title' => 'creative services',
   'pages' => array('focus'),
   'context' => 'normal',
   'fields' => array(),
   'local_images' => false,
   'use_with_theme' => true
);
$creative_services_meta = new Tax_Meta_Class($config);
$creative_services_meta->addTextarea('textarea_field_id',array('name'=> 'Creative Services '));
$creative_services_meta->Finish();

I dropped a note to @Bainternet on his websites FAQ. Hopefully he'll sort me out.

10
  • This doesn't happens to me in a 3.3.2 install. It may be a rogue plugin or theme function, and I'd suggest this troubleshooting.
    – brasofilo
    Jun 5, 2012 at 19:57
  • Thanks for the checking your install (and the link). I'll give it a read. Maybe its a theme function. My only plugins are Contact-Form-7 and Mailchimp. Jun 5, 2012 at 20:01
  • what does attempt means? it means saving/updating THE SAME post withouth changing title yes? Also did you try the fresh install with the same plugins and theme?
    – Tommixoft
    Jun 7, 2012 at 14:07
  • Yes - clicking update without changing anything. I disabled all plugins on a relatively fresh install I had, and installed the (un-modified) theme. The problem was not there. It must be something I did, or somehow related to the wpalchemy class or Tax-meta-class I'm using. I suppose I'll bite the bullet and test everything on a fresh install. Jun 7, 2012 at 14:16
  • ADDITION: I used mine function i suggested to you to see what WP gets before saving title to DB and in all cases, i did 3 updates - i got mail with - Jule\'s Gormet . SO i think problem is in your server that is enabled magic_quotes_gpc
    – Tommixoft
    Jun 7, 2012 at 14:18

1 Answer 1

1

EDIT:

Disable magic_quotes_gpc in your server. try adding in .HTACCESS file (if you on shared hosting): php_flag magic_quotes_gpc off If you'll get 500 server error after you added it - delete it and put this: ini_set ('magic_quotes_gpc', 0); in theme's functions.php file. And with function bellow check is it on.

You can create php file with this content to test is it on (if on you'll see this nice string):

if (get_magic_quotes_gpc()) {
    echo 'F@ck.. its on :D';
}

2nd try: If the magic quotes was ok, than MAYBE you can try and search in your plugins, and theme's php files (with textcrawler) do some of them uses stripslashes function on title?

16
  • Sorry, I guesse it was sort of ambiguous, but in the admin it is not ok. Also I don't think the entity decode will help, as it decodes Jule&&'s to Jule&&'s. I'll check out all the stuff you mentioned though. Thanks! Jun 5, 2012 at 21:05
  • As far as I know the encoding is UTF-8 - although other than settings>reading I'm not really sure how to check. Database is verified UTF-8 Jun 5, 2012 at 21:07
  • So.. its saving in the database as Jule's Gormet. I'll update my question with this new info, and check out some stuff. The htaccess file is pretty strandard. Idk what else to check... Should I call the host maybe (1&1)? Jun 5, 2012 at 21:13
  • Put this in your functions.php: function get_post_title($title) { wp_mail('[email protected]','the title',$title); return $title; } add_filter ('title_save_pre','get_post_title'); This will email you the title BEFORE it's stored to database, change email to your email, and after save you'll receive title -chack it does it come with good char? And write me.
    – Tommixoft
    Jun 6, 2012 at 6:45
  • Jule\'s Gormet - 1st attempt Jule's Gormet - 2nd attempt Jule\'s Gormet - 1st attempt Jule's Gormet - 3rd attempt Jule's Gormet - 2nd attempt Jule's Gormet - 4th attempt Jule's Gormet - 3rd attempt Jule's Gormet - 4th attempt Jun 6, 2012 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.