function redes_menu_abierto() { $opciones = get_redes(); foreach ($opciones as $k => $o) { echo $o === '' ? '' : '<a href="' . $o . '" class="redes_menu red_' . $k . '" target="_blank"></a>'; } }
<?php $opciones = get_redes(); $html .= header_secciones('Configurar links de redes sociales', 'guardar_redes'); $html .= '<hr class="hrconf1">'; $html .= '<div class="upcoming_reservations user_billing_data"><h2>Facebook:</h2></div>'; $html .= '<input class="input_redes third_input" type="text" placeholder="Link:" value="' . $opciones['facebook'] . '" name="facebook">'; $html .= '<div class="upcoming_reservations user_billing_data"><h2>Instagram:</h2></div>'; $html .= '<input class="input_redes third_input" type="text" placeholder="Link:" value="' . $opciones['instagram'] . '" name="instagram">'; $html .= '<div class="upcoming_reservations user_billing_data"><h2>Vimeo:</h2></div>'; $html .= '<input class="input_redes third_input" type="text" placeholder="Link:" value="' . $opciones['youtube'] . '" name="youtube">'; $html .= '<div class="upcoming_reservations user_billing_data"><h2>Twitter:</h2></div>'; $html .= '<input class="input_redes third_input" type="text" placeholder="Link:" value="' . $opciones['twitter'] . '" name="twitter">';
function guardar_redes($data = false) { global $admin; if (!$admin->permisos('Gafa')) { return; } if (!$data) { return; } $format_data = get_redes(); foreach ($data as $d) { $format_data[$d[0]] = $d[1]; } update_option('redes_sociales', $format_data); }