- This topic has 8 replies, 2 voices, and was last updated 7 years, 3 months ago by
Steve.
-
AuthorPosts
-
-
November 10, 2014 at 4:58 am #2699
ajayphpMemberadd_filter(‘piklist_pre_update_option’,’my_update_option’,10,3);
function my_update_option($settings, $setting, $new, $old)
{if ($setting == ‘piklist_demo_fields’]))
{
$settings[‘option_key’] = ‘option_value’;
}return $settings;
}
please update this code in doc, as that have error: (remove extra “])” from if expression)
add_filter(‘piklist_pre_update_option’,’my_update_option’,10,3);
function my_update_option($settings, $setting, $new, $old)
{if ($setting == ‘piklist_demo_fields’)
{
$settings[‘option_key’] = ‘option_value’;
}return $settings;
}
—
and when i tried with save setting for custom setting,
then ERROR: Warning: Missing argument 4 for biztel_sms_send_update() in /var/www/piklist/wp-content/plugins/ <this error for not find the $old array data > on line 81as that was unable to find the $old db data …
-
November 10, 2014 at 10:53 am #2706
-
November 10, 2014 at 11:07 am #2716
ajayphpMemberHi,
add_filter(‘piklist_pre_update_option’,’ – using for access data before save,
and logically when you are returning data base after modification,
that is understood nothing will save when callback to this functionupdate_option_update($settings, $setting, $new, $old = array())
so $old = array() , as default pre initialize to over error , what other for you have in mind,
which i am missing ?what is the hook you have for save admin page data ..?
-
November 10, 2014 at 11:10 am #2719
-
November 10, 2014 at 11:14 am #2721
ajayphpMemberI created plugin which is not relate to any WP post type of wp default table.
this is admin page gateways.php
main menu
form fields:
gateway title:
gateway Api URL:
Api username:
Api password..now how could i save these data into table gateways ..
???
-
November 10, 2014 at 11:36 am #2728
-
November 10, 2014 at 11:45 am #2729
ajayphpMemberHi,
if there would you add piklist_save_hook, then we could get form data and create custom query there.
so , could you guide me how can i add that hook , till you add this support for adding data custom table
please suggest me for now how to achieve this ..
-
November 10, 2014 at 2:23 pm #2732
ajayphpMemberHi,
I found the error :
https://piklist.com/user-guide/docs/piklist_pre_update_option/
please correct on the doc page, this took my lots of hours and have to make own solutions,
which is not needed if to be correct, never mind, happens ,take care next timeChange this to :
add_filter(‘piklist_pre_update_option’,’biztel_sms_send_update’,10,3);
WITH
add_filter(‘piklist_pre_update_option’,’biztel_sms_send_update’,10,4);corrected – error gone as in doc you passing 3 args, but actually 4 – so 4th $old was not passing
-
November 10, 2014 at 3:51 pm #2738
SteveKeymasterDocs have been updated. Thanks! Closing this ticket.
-
-
AuthorPosts
- The topic ‘piklist_pre_update_option – $old array error’ is closed to new replies.