/** * Imports posts from the current master branch */ public function import_master() { $commit = $this->api->last_commit(); if (is_wp_error($commit)) { WordPress_GitHub_Sync::write_log(__('Failed getting last commit with error: ', WordPress_GitHub_Sync::$text_domain) . $commit->get_error_message()); return; } if ('wpghs' === substr($commit->message, -5)) { WordPress_GitHub_Sync::write_log(__('Already synced this commit.', WordPress_GitHub_Sync::$text_domain)); return; } $this->import_tree($commit->tree->sha); }
/** * Imports posts from the current master branch */ public function import_master() { $commit = $this->api->last_commit(); if (is_wp_error($commit)) { WordPress_GitHub_Sync::write_log(__('Failed getting last commit with error: ', 'wordpress-github-sync') . $commit->get_error_message()); return; } if ('wpghs' === substr($commit->message, -5)) { WordPress_GitHub_Sync::write_log(__('Already synced this commit.', 'wordpress-github-sync')); return; } $import = new WordPress_GitHub_Sync_Import(); $import->run($commit->tree->sha); }