-
' . $tabsHtml . '
' . $sharingToolsCardTitle . '
' . $sharingToolsDescription . '
' . $sharingToolsButtonText . ' →If you don\'t see your tools after configuring them in the dashboard, please contact AddThis Support
addThisConfigs = $addThisConfigs; $this->cmsConnector = $cmsConnector; // Save async load settings via ajax request add_action( 'wp_ajax_at_async_loading', array($this, 'addthisAsyncLoading')); $this->_upgrade = $upgrade; $this->_getVariables = $_GET; $this->_postVariables = $_POST; $this->_options = $this->addThisConfigs->getConfigs(); include_once 'addthis-toolbox.php'; $this->addThisToolBox = new Addthis_ToolBox($addThisConfigs, $cmsConnector); add_action('admin_menu', array($this, 'addToWordpressMenu')); // Deactivation register_deactivation_hook( ADDTHIS_PLUGIN_FILE, array($this, 'pluginDeactivation') ); // Settings link in plugins page $plugin = 'addthis/addthis_social_widget.php'; add_filter( "plugin_action_links_$plugin", array($this, 'addSettingsLink') ); } /* * Function to add settings link in plugins page * * @return null */ public function addSettingsLink($links) { $settingsLink = 'Settings'; array_push($links, $settingsLink); return $links; } /** * Functions to execute on plugin deactivation * * @return null */ public function pluginDeactivation() { if (get_option('addthis_run_once')) { delete_option('addthis_run_once'); } } /** * Adds sub menu page to the WP settings menu * * @return null */ public function addToWordpressMenu() { $htmlGeneratingFunction = array($this, 'addthisWordpressOptions'); $this->cmsConnector->addSettingsPage($htmlGeneratingFunction); } /** * Manages the WP settings page * * @return null */ public function addthisWordpressOptions() { $updateResult = null; if ($this->_checkAddPubid()) { $updateResult = $this->updateSettings($this->_postVariables); } echo $this->_getHTML($updateResult); } /** * Updates addthis profile id * * @param string $pubId Addthis public id * * @return string */ public function updateSettings($settings) { if (!empty($settings['addthis_settings'])) { $this->_options = $this->addThisConfigs->saveSubmittedConfigs($settings['addthis_settings']); } return '
' . $sharingToolsDescription . '
' . $sharingToolsButtonText . ' →If you don\'t see your tools after configuring them in the dashboard, please contact AddThis Support