Skip to content

Instantly share code, notes, and snippets.

@Nor1m
Created April 21, 2018 09:01
Show Gist options
  • Save Nor1m/db3181748df65bd746a9fe0ca0f217be to your computer and use it in GitHub Desktop.
Save Nor1m/db3181748df65bd746a9fe0ca0f217be to your computer and use it in GitHub Desktop.
// если пост на стене группы
if ( strpos( $this -> link , '-') !== false ) {
$this -> owner_id = '-' . explode ( '-', explode('_', $this -> link)[0] )[1];
$this -> item_id = explode( '_', $this -> link )[1];
}
// если пост на стене юзера
else {
$this -> owner_id = explode ( '_', explode('wall', $this -> link)[1] )[0];
$this -> item_id = explode ( '_', explode('wall', $this -> link)[1] )[1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment