Wordpress User Administrator

0

I am editing the WordPress code to add a file upload button but it does not save it in the database, where could it be modified to save it in the database?,

modify the edit-user file that comes with WordPress and just add the buttons to upload files but do not save it in the edited user's databases, the buttons have a jQuery function to add several buttons to upload several files and delete a file

BUTTONS

<div id="main">
    <label for="subir"Archivo</label>
    <input type="button" id="btAdd" value="Añadir Archivo" class="bt" />
    <input type="button" id="btRemove" value="Eliminar Archivo" class="bt" />
    <input type="button" id="btRemoveAll" value="Eliminar Todo" class="bt" /><br />
</div>

JQUERY

$(document).ready(function() {
var iCnt = 0;

// Crear un elemento div añadiendo estilos CSS
var container = $(document.createElement('div')).css({
padding: '5px', margin: '20px', width: '170px', border: '1px dashed',
borderTopColor: '#999', borderBottomColor: '#999',
borderLeftColor: '#999', borderRightColor: '#999'
});

$('#btAdd').click(function() {
if (iCnt <= 19) {

iCnt = iCnt + 1;

// Añadir caja de texto.
$(container).append('<input input type="file" name="archivo" class="input" id=tb' + iCnt + ' ' +
'value="Elemento de Texto ' + iCnt + '" />');

if (iCnt == 1) {

var divSubmit = $(document.createElement('div'));
$(divSubmit).append('<input type=button class="bt" onclick="GetTextValue()"' +
'id=btSubmit value=Enviar />');

}

$('#main').after(container, divSubmit);
}
else { //se establece un limite para añadir elementos, 20 es el limite

$(container).append('<label>Limite Alcanzado</label>');
$('#btAdd').attr('class', 'bt-disable');
$('#btAdd').attr('disabled', 'disabled');

}
});

$('#btRemove').click(function() { // Elimina un elemento por click
if (iCnt != 0) { $('#tb' + iCnt).remove(); iCnt = iCnt - 1; }

if (iCnt == 0) { $(container).empty();

$(container).remove();
$('#btSubmit').remove();
$('#btAdd').removeAttr('disabled');
$('#btAdd').attr('class', 'bt')

}
});

$('#btRemoveAll').click(function() { // Elimina todos los elementos del contenedor

$(container).empty();
$(container).remove();
$('#btSubmit').remove(); iCnt = 0;
$('#btAdd').removeAttr('disabled');
$('#btAdd').attr('class', 'bt');

});
});
    
asked by Edison Sarmiento 13.02.2018 в 16:45
source

0 answers