get_option( 'show_sync' ); if ( is_array( $show_sync ) ) { $show_sync = in_array( get_current_user_id(), $show_sync ); } if ( ! $show_sync && current_user_can( 'manage_options' ) ) { $user_id = get_current_user_id(); if ( isset( $_GET['ithemes-sync-force-display'] ) ) { if ( ! empty( $_GET['ithemes-sync-force-display'] ) ) { $show_sync = true; set_site_transient( "ithemes-sync-force-display-$user_id", true, 600 ); if ( false === $this->silent_mode_enabled() ) { add_action( 'all_admin_notices', array( $this, 'show_force_display_notice' ), 0 ); } } else { delete_site_transient( "ithemes-sync-force-display-$user_id" ); if ( false === $this->silent_mode_enabled() ) { add_action( 'all_admin_notices', array( $this, 'show_force_display_disable_notice' ), 0 ); } } } else if ( false !== get_site_transient( "ithemes-sync-force-display-$user_id" ) ) { $show_sync = true; if ( false === $this->silent_mode_enabled() ) { add_action( 'all_admin_notices', array( $this, 'show_force_display_notice' ), 0 ); } } } if ( $show_sync && ( false === $this->silent_mode_enabled() ) ) { if ( ! is_multisite() || is_super_admin() ) { add_action( 'admin_menu', array( $this, 'add_admin_pages' ) ); } add_action( 'network_admin_menu', array( $this, 'add_network_admin_pages' ) ); if ( current_user_can( 'manage_options' ) ) { if ( ! get_site_option( 'ithemes-sync-authenticated' ) && ( empty( $_GET['page'] ) || ( $this->page_name != $_GET['page'] ) ) && ! get_site_option( 'ithemes_sync_hide_authenticate_notice' ) ) { require_once( $GLOBALS['ithemes_sync_path'] . '/functions.php' ); $path_url = Ithemes_Sync_Functions::get_url( $GLOBALS['ithemes_sync_path'] ); wp_enqueue_style( 'ithemes-updater-admin-notice-style', "$path_url/css/admin-notice.css" ); wp_enqueue_script( 'ithemes-updater-admin-notice-script', "$path_url/js/admin-notice.js", array( 'jquery' ) ); if ( false === $this->silent_mode_enabled() ) { add_action( 'all_admin_notices', array( $this, 'show_authenticate_notice' ), 0 ); } delete_site_transient( 'ithemes-sync-activated' ); } else if ( ! empty( $_GET['activate'] ) && get_site_transient( 'ithemes-sync-activated' ) ) { require_once( $GLOBALS['ithemes_sync_path'] . '/functions.php' ); $path_url = Ithemes_Sync_Functions::get_url( $GLOBALS['ithemes_sync_path'] ); wp_enqueue_style( 'ithemes-updater-admin-notice-style', "$path_url/css/admin-notice.css" ); wp_enqueue_script( 'ithemes-updater-admin-notice-script', "$path_url/js/admin-notice.js", array( 'jquery' ) ); if ( false === $this->silent_mode_enabled() ) { add_action( 'all_admin_notices', array( $this, 'show_activate_notice' ), 0 ); } delete_site_transient( 'ithemes-sync-activated' ); } } } else { add_action( 'load-plugins.php', array( $this, 'modify_plugins_page' ) ); } } public function show_activate_notice() { if ( is_multisite() && is_network_admin() ) $url = network_admin_url( 'settings.php' ) . "?page={$this->page_name}"; else $url = admin_url( 'options-general.php' ) . "?page={$this->page_name}"; ?>
Manage Sync ×', 'it-l10n-ithemes-sync' ), $url ); ?>
page_name}"; else $url = admin_url( 'options-general.php' ) . "?page={$this->page_name}"; ?>
Set Up Sync ×', 'it-l10n-ithemes-sync' ), $url ); ?>

here to hide iThemes Sync again.', 'it-l10n-ithemes-sync' ), $time_diff, $url ); ?>

page_ref = add_options_page( __( 'iThemes Sync', 'it-l10n-ithemes-sync' ), __( 'iThemes Sync', 'it-l10n-ithemes-sync' ), 'manage_options', $this->page_name, array( $this, 'settings_index' ) ); add_action( "load-{$this->page_ref}", array( $this, 'load_settings_page' ) ); } public function add_network_admin_pages() { $this->page_ref = add_submenu_page( 'settings.php', __( 'iThemes Sync', 'it-l10n-ithemes-sync' ), __( 'iThemes Sync', 'it-l10n-ithemes-sync' ), 'manage_options', $this->page_name, array( $this, 'settings_index' ) ); add_action( "load-{$this->page_ref}", array( $this, 'load_settings_page' ) ); } public function load_settings_page() { require_once( $GLOBALS['ithemes_sync_path'] . '/settings.php' ); require( $GLOBALS['ithemes_sync_path'] . '/settings-page.php' ); } public function settings_index() { do_action( 'ithemes_sync_settings_page_index' ); } private function set_package_details() { if ( false !== $this->package_details ) return; require_once( $GLOBALS['ithemes_updater_path'] . '/packages.php' ); $this->package_details = Ithemes_Updater_Packages::get_local_details(); } private function set_registration_link() { if ( false !== $this->registration_link ) return; $url = admin_url( 'options-general.php' ) . "?page={$this->page_name}"; $this->registration_link = sprintf( '%3$s', $url, __( 'Manage iThemes product licenses to receive automatic upgrade support', 'it-l10n-ithemes-sync' ), __( 'License', 'it-l10n-ithemes-sync' ) ); } public function filter_plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) { $this->set_package_details(); $this->set_registration_link(); if ( isset( $this->package_details[$plugin_file] ) ) $actions[] = $this->registration_link; return $actions; } public function filter_theme_action_links( $actions, $theme ) { $this->set_package_details(); $this->set_registration_link(); if ( is_object( $theme ) ) $path = basename( $theme->get_stylesheet_directory() ) . '/style.css'; else if ( is_array( $theme ) && isset( $theme['Stylesheet Dir'] ) ) $path = $theme['Stylesheet Dir'] . '/style.css'; else $path = ''; if ( isset( $this->package_details[$path] ) ) $actions[] = $this->registration_link; return $actions; } /** * Adds privacy content to wp-admin/tools.php?wp-privacy-policy-guide * * @since 2.0.9 * @return void */ function add_privacy_content() { if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { return; } $content = '

' . __( 'Where we send your data', 'it-l10n-ithemes-sync' ) . '

'; $content .= sprintf( __( "%s%sSuggested text:%s This web site uses a third party service to manage administrative tasks. If you leave a comment, submit personal information via a contact form, or otherwise exchange personal details with us, it is possible that we may use this service to manage that data. Please visit the %siThemes Privacy Policy%s for more information regarding the way they handle their data.%s%s", 'it-l10n-ithemes-sync' ), '

', '', '', '', '', '

', '
' ); wp_add_privacy_policy_content( 'iThemes Sync', wp_kses_post( wpautop( $content, false ) ) ); } /** * Returns boolean depending on whether silent mode is enabled or not. * * Silent mode kills all sync admin notices as well as the menu item and admin page. * * @since 2.0.14 * @return boolean */ function silent_mode_enabled() { return apply_filters( 'ithemes-sync-silent-mode-enabled', false ); } } new Ithemes_Sync_Admin();