Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a wordpress site with more than 70 pages of different brand car offers. Each page has a custom field named Price with a numeric value.

This is what I got so far:

function setup_modificari_pret() {
    'Modificari pret', 'Madificari Pret', 'manage_options',
    'modificari-pret', 'setari_modificari_pret');
add_action("admin_menu", "setup_modificari_pret");

function setari_modificari_pret() {
<div class="wrap">
    <?php screen_icon('themes'); ?> <h2>Modificari de pret</h2>
    <form method="POST" action="">
        <table class="form-table">
            <tr valign="top">
                <th scope="row">
                    <label for="modifica_pret">
                        Valoare numerica:
                        <input type="text" name="modifica_pret" value="<?php echo $pret_modificat;?>" size="5" /> %

    <input type="submit" value="Save" class="button-primary"/>


if (isset($_POST["update_settings"])) {
$pret_modificat = esc_attr($_POST["pret_modificat"]);  
update_option("nume_tema", $pret_modificat);
$pret_modificat = get_option("nume_tema");

I want to add an option page settings to update all the prices from the database with the possibility to increase or decrease them with 10%. How can I achieve this ?

share|improve this question
Achieve what, specifically? Where does this fail? Do you want to change prices in the database or change them on display? – s_ha_dum Feb 18 '14 at 15:12
Change them in the database – noctis Feb 18 '14 at 16:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.