function ssba_menu() { // add menu page add_options_page('Simple Share Buttons Adder', 'Share Buttons', 'manage_options', 'simple-share-buttons-adder', 'ssba_settings'); // query the db for current ssba settings $arrSettings = get_ssba_settings(); // check if not updated to current version if ($arrSettings['ssba_version'] != SSBA_VERSION) { // run the upgrade function upgrade_ssba($arrSettings); } }
function ssba_menu() { // add menu page add_options_page('Simple Share Buttons Adder', 'Share Buttons', 'manage_options', 'simple-share-buttons-adder', 'ssba_settings'); // query the db for current ssba settings $arrSettings = get_ssba_settings(); // get the current version $version = get_option('ssba_version'); // there was a version set if ($version !== false) { // check if not updated to current version if ($version < SSBA_VERSION) { // run the upgrade function upgrade_ssba($arrSettings, $version); } } }
function ssba_menu() { // add menu page add_options_page('Simple Share Buttons Adder', 'Share Buttons', 'manage_options', 'simple-share-buttons-adder', 'ssba_settings'); // query the db for current ssba settings $arrSettings = get_ssba_settings(); // check if not updated to current version if ($arrSettings['ssba_version'] != SSBA_VERSION) { // run the upgrade function upgrade_ssba($arrSettings); } // check if any buttons have been selected if ($arrSettings['ssba_selected_buttons'] == '' && isset($_GET['page']) && $_GET['page'] != 'simple-share-buttons-adder') { // output a warning that buttons need configuring and provide a link to settings echo '<div id="ssba-warning" class="updated fade"><p>Your <strong>Simple Share Buttons</strong> need <a href="admin.php?page=simple-share-buttons-adder"><strong>configuration</strong></a> before they will appear. <strong>View the tutorial video <a href="http://www.youtube.com/watch?v=p03B4C3QMzs" target="_blank">here</a></strong></p></div>'; } }