get $post in init filter or action?

Turns out the answer was simply to use url_to_postid like this:

$keyword = get_post_meta( url_to_postid( "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] ), '_wpg_def_keyword', true );

Works perfectly even from init.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)