WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on an old WP Multisite instalation (3.0.1) and something weird is happening.

The guy who built the site made a decision to store direct URLs instead of Post IDs to a Custom Field. And this is creeping me with:

// String stored on the database: `http://example.com/wp-content/uploads/2012/07/filename.pdf`
// Code
$cf = get_post_custom($post->ID);
$pdf = $cf['meta_key'][0];
// Result
$pdf == 'http://example.com/wp-content/sitename/files/2012/07/filename.pdf' // true

Any ideas why this might be happening? Why is the URL string being rewritten?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.