From fbef6f63d3b7eb75334bc0967b2692ec01b18d63 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Mar 2019 13:02:41 -0400 Subject: [PATCH] add link to settings page on notification --- inc/class-roeintegration.php | 2 +- roe-pressbooks.php | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/inc/class-roeintegration.php b/inc/class-roeintegration.php index b725b0e..51ef3b5 100644 --- a/inc/class-roeintegration.php +++ b/inc/class-roeintegration.php @@ -32,7 +32,7 @@ class ROEIntegration extends Export { error_log(print_r($output, true));*/ $siteurl = get_site_url(get_current_blog_id()); - $identifier = isset($this->bookMeta['pb_print_isbn']) ? $this->bookMeta['pb_print_isbn'] : "url:md5:".md5($siteurl); + $identifier = isset($this->bookMeta['pb_print_isbn']) ? ("urn:isbn:" . $this->bookMeta['pb_print_isbn']) : ("url:md5:" . md5($siteurl)); $timestamp = (new \DateTime())->format('c'); $output = [ "metadata" => [ diff --git a/roe-pressbooks.php b/roe-pressbooks.php index 2482aec..4755c82 100644 --- a/roe-pressbooks.php +++ b/roe-pressbooks.php @@ -58,23 +58,20 @@ if ( ! \Pressbooks\Book::isBook() ) { $updater->setBranch( 'master' ); } -function roe_check_compatibility () { - if ( is_plugin_active('roe-pressbooks/roe-pressbooks.php') && is_network_admin() ) { - if ( ! \ROE\ROEIntegration::is_active() ) { - add_action( 'network_admin_notices', '_roe_show_set_config' ); - } - } -} function _roe_show_set_config () { echo '

'; _e('Please configure your site\'s publisher id and secret. It is required to publish to the River of Ebooks.', 'roe-pressbooks'); - echo '

'; + echo '

'; _e('Settings', 'roe-pressbooks'); echo '
'; } -roe_check_compatibility(); +if ( is_plugin_active('roe-pressbooks/roe-pressbooks.php') && is_network_admin() ) { + if ( ! \ROE\ROEIntegration::is_active() ) { + add_action( 'network_admin_notices', '_roe_show_set_config' ); + } +} add_filter( 'pb_active_export_modules', function ( $modules ) { if ( isset( $_POST['export_formats']['roe'] ) && \ROE\ROEIntegration::is_active() ) {