751 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United States
CyberShot says

I am working in the wordpress admin area. Everything is working and I am not getting any errors but when I press the save button on my form, the database does not get updated. How do you figure out why this is when you don’t get any error messages?

2566 posts Put a Donk On It
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • United Kingdom
  • Exclusive Author
  • Attended a Community Meetup
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 200 and 499 users
+5 more
ThemeProvince says

I am working in the wordpress admin area. Everything is working and I am not getting any errors but when I press the save button on my form, the database does not get updated. How do you figure out why this is when you don’t get any error messages?

Open wp-config.php

Change WPDEBUG to true.

751 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United States
CyberShot says

Thank you for that thePhoenix. That did show me what the problem was. but I have no idea what this error means.

Undefined index: update_slider_options

that is the name of my save button in a meta_box for a custom post type. Defined like so


<?php if ( $_POST['update_slider_options'] == 'true' ) { slider_options_update(); } ?>
<input name="update_slider_options" value="true" type="hidden" />
<input name="update_slider_options" class="button" value="Update Options" type="submit" />

do you have any idea?

2566 posts Put a Donk On It
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • United Kingdom
  • Exclusive Author
  • Attended a Community Meetup
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 200 and 499 users
+5 more
ThemeProvince says

Some errors generated make no sense so I just disabled that feature. But I thought it might solve your thread’s issues.

367 posts plop
  • Elite Author
  • Sold between 50 000 and 100 000 dollars
  • Beta Tester
  • Has been a member for 5-6 years
  • Grew a moustache for the Envato Movember competition
  • Referred between 50 and 99 users
  • Interviewed on the Envato Notes blog
+3 more
kimonoThemes says

Firebug + FirePHP

1148 posts
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
  • United States
fillerspace says

Thank you for that thePhoenix. That did show me what the problem was. but I have no idea what this error means.

Undefined index: update_slider_options

That means that “update_slider_options” was not found in the $_POST array

Check these two things:

Is the form method POST ?

Also, you have two inputs with that name, the hidden one and the submit button.

Try print_r($_POST) to see the full array

751 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United States
CyberShot says

I tried the print_r and all I got was Array(). I did check the code and both are there. now I am getting no errors, it still just isn’t updating the database

would you give my code a once over? it’s 127 lines

http://pastebin.com/GDp04xac

58 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 250 000 and 1 000 000 dollars
DigitalCavalry says

You need experience, experience and experience and var_dump function. :)

751 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United States
CyberShot says

I am afraid I don’t understand your post. What are your trying to say?

1148 posts
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
  • United States
fillerspace says

I added this:

slider_options_meta_box();

Right before the

add_action('admin_init', 'manager_init');

And I changed

function slider_options_meta_box($post) {

To

function slider_options_meta_box() {

And everything works for me

by
by
by
by
by
by