/** * An update is required, do it * * @param $current_version */ private function do_upgrade($current_version) { // Upgrade to version 1.7.0 if (version_compare($current_version, '1.7.0', '<')) { // Adding new capabilities $installer = new DLM_Installer(); $installer->init_user_roles(); // Set default 'No access message' $dlm_no_access_error = get_option('dlm_no_access_error', ''); if ('' === $dlm_no_access_error) { update_option('dlm_no_access_error', sprintf(__('You do not have permission to access this download. %sGo to homepage%s', 'download-monitor'), '<a href="' . home_url() . '">', '</a>')); } } // Upgrade to version 1.9.0 if (version_compare($current_version, '1.9.0', '<')) { // Adding new capabilities $installer = new DLM_Installer(); $installer->create_no_access_page(); // setup no access page endpoints $no_access_page_endpoint = new DLM_Download_No_Access_Page_Endpoint(); $no_access_page_endpoint->setup(); // flush rules after page creation flush_rewrite_rules(); } }
/** * An update is required, do it * * @param $current_version */ private function do_upgrade($current_version) { // Upgrade to version 1.7.0 if (version_compare($current_version, '1.7.0', '<')) { // Adding new capabilities $installer = new DLM_Installer(); $installer->init_user_roles(); // Set default 'No access message' $dlm_no_access_error = get_option('dlm_no_access_error', ''); if ('' === $dlm_no_access_error) { update_option('dlm_no_access_error', sprintf(__('You do not have permission to access this download. %sGo to homepage%s', 'download-monitor'), '<a href="' . home_url() . '">', '</a>')); } } }