It cannot be in post metabox, because it is site setting, not specific page. You can create submenu position for settings in your admin panel by add_submenu_page
function, for example:
add_action('admin_menu', 'add_my_settings_submenu_page');
function add_my_settings_submenu_page() {
add_submenu_page('options-general.php', 'Page title', 'Menu title', 'manage_options', 'my_settings', 'my_settings_submenu_callback');
}
Then you need to create callback for last argument where will be all logic of your code. This should be something like this:
<?php function my_settings_submenu_callback() {
if (isset($_POST['disable_footer_social'])) {
update_option('disabled_footer_social', $_POST['disable_footer_social']);
}
$option = (bool) get_option('disabled_footer_social', false);
?>
<div class="wrap">
<h1>My Settings</h1>
<form method="post">
<table class="form-table">
<th>Disable footer social buttons</th>
<td>
<input type="hidden" name="disable_footer_social" value="0">
<label>
<input type="checkbox" name="disable_footer_social" value="1" <?php echo $option ? 'checked="checked"' : ''; ?>>
Disable
</label>
</td>
</table>
<?php submit_button('Submit'); ?>
</form>
</div>
</table>
<?php }
In your footer you can check if this option is checked by get_option('disabled_footer_social')
, for example:
if (get_option('disabled_footer_social', false) != 1) {
// show your buttons
}