如何在WordPress中覆盖get_post函数?

I have URL like this in my WordPress http://www.example.com/wp-admin/post.php?post=87&action=edit&lang=de-DE and I need to override function which select post by ID from table wp_posts. I have another table in SQL and because of $_GET['lang'] parameter I need to use data from this table, so I need to override whole function, not only the WHERE part.

When I select the right post from table, than I would like to use the default template. Is it possible to return data from overridden function back and use them in default WordPress template?

Depending on the function you are trying to override, WordPress does support that. You can do it via a plugin or via the functions.php file depending on the functionality you wish to achieve (which is a bit hard to determine based on your question)

Here is a list of pluggable functions: http://codex.wordpress.org/Pluggable_Functions

And here is a tutorial on how to use them: http://code.tutsplus.com/articles/understanding-wordpress-pluggable-functions-and-their-usage--wp-30189

After your comment, I am adding this addendum:

In your case, it sounds as if you want to use add_query_vars in your functions.php file so that Wordpress is aware of that query string (GET var). Then you can use query_vars property to get your specific var (lang) and use it (along with get_results) to to query your custom table.

Add query vars in function.php:

function add_query_vars($vars) {
    $vars[] = "lang";
    return $vars;
}

add_filter('query_vars', 'add_query_vars');

This is how you get the vars from the URL in your template file or whatever:

$lang = get_query_var( 'lang' );

http://codex.wordpress.org/Function_Reference/get_query_var

Then you would just use the info you retrieve in a get_results custom query to your specific table...assuming your table has the correct prefix, etc...

https://codex.wordpress.org/Class_Reference/wpdb#Using_the_.24wpdb_Object