Set up basic hook for Spee.ch asset upload

This commit is contained in:
Paul Kirby 2018-09-13 19:42:38 -05:00
parent 18c26ab330
commit 6573253d5a

View file

@ -18,6 +18,7 @@ class LBRY_Speech
public function __construct() public function __construct()
{ {
$this->parser = new LBRY_Speech_Parser(); $this->parser = new LBRY_Speech_Parser();
add_action('save_post', $this->upload_assets);
} }
/** /**
@ -31,4 +32,19 @@ class LBRY_Speech
ob_start(array($this->parser, 'rewrite')); ob_start(array($this->parser, 'rewrite'));
} }
} }
/**
* Uploads assets to the speech server
*/
public function upload_assets()
{
$speech_url = get_option(LBRY_SETTINGS)[LBRY_SPEECH];
// Die if we don't have a spee.ch url
if (!$speech_url || $speech_url === '') {
return;
}
// TODO: Find assets, upload them to the Spee.ch Server
}
} }