Soma de resultados “Meta box”
-
Preciso de uma ajuda para fazer três campos Metabox(array) diferente efetuar a soma e no quarto metabox mostre o total dos três campos segue abaixo o código.
array(
‘id’ => ‘renda1’, // Obrigatório
‘label’ => __( ‘Renda R$:’, ‘odin’ ), // Obrigatório
‘type’ => ‘input’, // Obrigatório
‘default’ => ”, // Opcional (deve ser o id de uma imagem em mídias, separe os
ids com virtula)
‘description’ => __( ‘Somente números inteiros’, ‘odin’ ), // Opcional
‘attributes’ => array( // Optional (html input elements)
‘type’ => ‘number’,
‘max’ => 99999,
‘min’ => 0
)
),array(
‘id’ => ‘renda3’, // Obrigatório
‘label’ => __( ‘Renda R$:’, ‘odin’ ), // Obrigatório
‘type’ => ‘input’, // Obrigatório
‘default’ => ”, // Opcional (deve ser o id de uma imagem em mídias, separe os
ids com virtula)
‘description’ => __( ‘Somente números inteiros’, ‘odin’ ), // Opcional
‘attributes’ => array( // Optional (html input elements)
‘type’ => ‘number’,
‘max’ => 99999,
‘min’ => 0
)
),array(
‘id’ => ‘renda3’, // Obrigatório
‘label’ => __( ‘Renda R$:’, ‘odin’ ), // Obrigatório
‘type’ => ‘input’, // Obrigatório
‘default’ => ”, // Opcional (deve ser o id de uma imagem em mídias, separe os
ids com virtula)
‘description’ => __( ‘Somente números inteiros’, ‘odin’ ), // Opcional
‘attributes’ => array( // Optional (html input elements)
‘type’ => ‘number’,
‘max’ => 99999,
‘min’ => 0
)
),
array(
‘id’ => ‘total’, // Obrigatório
‘label’ => __( ‘Renda R$:’, ‘odin’ ), // Obrigatório
‘type’ => ‘input’, // Obrigatório
‘default’ => ”, // Opcional (deve ser o id de uma imagem em mídias, separe os
ids com virtula)
‘description’ => __( ‘Somente números inteiros’, ‘odin’ ), // Opcional
‘attributes’ => array( // Optional (html input elements)
‘type’ => ‘number’,
‘max’ => 99999,
‘min’ => 0
)
),
-
@raphaelgs primeiramente para entender melhor sua necessidade, você precisa que a soma seja feita automaticamente no admin ou no frontend quando a pessoa estiver visualizando a página em questão?
@everaldomatias feita automaticamente no admin
- O tópico ‘Soma de resultados “Meta box”’ está fechado para novas respostas.