global scope not working in 2.6 – how do I…
-
I’m updating a plugin from WP 2.3 to 2.6. Trying to get the current
$post_id
when running a function as the “upload_dir”-filter. This is what I’ve tried so far:global $post_id; global $post; $post_id = $post->ID; global $wp_query; $post_id = $wp_query->post->ID;
None of these produce the post id. Is the global scope somehow disabled in WP 2.6? How can I get the
$post_id
?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘global scope not working in 2.6 – how do I…’ is closed to new replies.