Serious problem of changing globals
-
You have a serious problem in create_post_related() in that it changes the value of (at least) the global $post variable and totally resets the the WP query. Given that you cannot know where this function is going to be called from, it’s potentially disastrous to blindly change the current state of the global WP variables – at least without restoring them to their state when your function was called – before your function exits.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Serious problem of changing globals’ is closed to new replies.