WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.