hook_suffix = add_options_page(
'Add to Calendar Settings',
'Add to Calendar',
'manage_options',
'add-to-calendar-setting',
array( $this, 'atcb_settings_create_admin_page' )
);
}
public function atcb_settings_create_admin_page() {
$this->options = get_option( 'atcb_global_settings' );
$locale = get_Locale();
$language = explode( '_', $locale )[0];
$supportedLanguages = ['en', 'de'];
if ($language == 'en' or !in_array($language, $supportedLanguages)) {
$language = '';
} else {
$language .= '/';
}
$configLink = 'add-to-calendar-button.com/' . $language . 'configuration';
$configProLink = 'docs.add-to-calendar-pro.com/' . $language . 'integration/wordpress';
$proLink = 'https://add-to-calendar-pro.com/' . $language;
$is_pro = isset($this->options['atcb_pro_active']) && ($this->options['atcb_pro_active'] === 'true' || $this->options['atcb_pro_active'] === true) ? true : false;
?>
',
( isset( $this->options['atcb_pro_active'] ) && ($this->options['atcb_pro_active'] === 'true' || $this->options['atcb_pro_active'] === true) ) ? 'checked' : ''
);
}
public function atcb_settings_header() {
$screen = get_current_screen();
if ( $this->hook_suffix === $screen->id ) {
$locale = get_Locale();
$language = explode( '_', $locale )[0];
$supportedLanguages = ['en', 'de'];
if ($language == 'en' or !in_array($language, $supportedLanguages)) {
$language = '';
} else {
$language .= '/';
}
$this->options = get_option( 'atcb_global_settings' );
$is_pro = isset($this->options['atcb_pro_active']) && ($this->options['atcb_pro_active'] === 'true' || $this->options['atcb_pro_active'] === true) ? true : false;
$service_links = [
[
'url' => 'https://wordpress.org/support/plugin/add-to-calendar-button/',
'title' => __( 'Support', 'add-to-calendar-button' ) . ' ↗',
'target' => '_blank',
'icon' => ' ',
],
[
'url' => 'https://wordpress.org/support/plugin/add-to-calendar-button/reviews/#new-post',
'title' => __( 'Review', 'add-to-calendar-button' ) . ' ↗',
'target' => '_blank',
'icon' => ' ',
],
];
?>
hook_suffix === $current_screen->id ) {
$footer_text = '' . esc_html__( $this->plugin_title ) . ' ' . ATCB_PLUGIN_VERSION . '. Please rate the plugin ★★★★★ to keep the wheels turning. Thank you!';
}
return $footer_text;
}
}
if (is_admin()) $atcb_settings_page = new ATCBSettingsPage();
?>