isset($options['citation_style']['prefer_custom']) ? $options['citation_style']['prefer_custom'] : false,
'style' => (isset($options['citation_style']['style']) ? $options['citation_style']['style'] : (isset($options['abt_citation_style']) ? $options['abt_citation_style'] : 'american-medical-association')),
'custom_url' => isset($options['citation_style']['custom_url']) ? $options['citation_style']['custom_url'] : '',
);
$newOptions
['custom_css'] = isset($options['custom_css']) ? $options['custom_css'] : '';
$newOptions
['display_options'] = array(
'bibliography' => isset($options['display_options']['bibliography']) ? $options['display_options']['bibliography'] : 'fixed',
'links' => isset($options['display_options']['links']) ? $options['display_options']['links'] : 'always',
'bib_heading' => isset($options['display_options']['bib_heading']) ? $options['display_options']['bib_heading'] : '',
'bib_heading_level' => isset($options['display_options']['bib_heading_level']) ? $options['display_options']['bib_heading_level'] : 'h3',
);
$newOptions
['VERSION'] = ABT_VERSION;
update_option('abt_options', $newOptions);
}
add_action('admin_init', 'abt_refactor_deprecated_options');
/**
* Adds link on the plugin page to the options page.
* @param [array] $links Array of links
*/
function abt_add_options_link($links) {
$url = admin_url('options-general.php?page=abt-options');
$text = __('Plugin Settings', 'academic-bloggers-toolkit');
$abt_links = array(
"$text",
);
return array_merge($links, $abt_links);
}
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'abt_add_options_link');
/**
* Adds donation link to the plugin meta
*/
function abt_add_donate_link( $plugin_meta, $plugin_file ) {
if (plugin_basename( __FILE__ ) == $plugin_file) {
$plugin_meta[] = sprintf(
'♥ %s',
'https://donorbox.org/academic-bloggers-toolkit',
__( 'Donate', 'academic-bloggers-toolkit' )
);
}
return $plugin_meta;
}
add_filter('plugin_row_meta', 'abt_add_donate_link', 10, 2);
/**
* Enqueues frontend JS and CSS
*/
function abt_frontend_scripts() {
wp_enqueue_style('dashicons');
wp_enqueue_style('abt_frontend_styles', plugins_url('academic-bloggers-toolkit/lib/css/frontend.css'), array('dashicons'), ABT_VERSION);
if (is_singular()) {
wp_enqueue_script('abt-bundle', plugins_url('academic-bloggers-toolkit/vendor/vendor.bundle.js'), array(), ABT_VERSION, true);
wp_enqueue_script('abt_frontend_js', plugins_url('academic-bloggers-toolkit/lib/js/Frontend.js'), array('abt-bundle'), ABT_VERSION, true);
}
}
add_action('wp_enqueue_scripts', 'abt_frontend_scripts');
require_once('lib/php/dom-injects.php');
require_once('lib/php/backend.php');
require_once('lib/php/options-page.php');
require_once('lib/php/endpoints.php');
?>