#3386 closed defect (bug) (fixed)
Allow editing posts forever is not configurable.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | API - Settings/Options | Keywords: | |
Cc: |
Description
Inside the settings of bbPress, there is an option called "Editing". If I enable it and set it to "0", the users should be able to edit endless.
But if I set it to "0" and let the change apply, it will be reset to "5". I can set it to "1", to "5" and to "100" - but not to "0".
Is this a bug? If not: How can I allow the users to edit their post forever?
Change History (7)
#2
@
5 years ago
I analyzed this bug more detailed:
If I set the value to "0" it will apply into the options table of WordPress.
But if I reopen the website of the bbPress options, it shows the default value (5) nevertheless.
This happens, since in the function "bbp_admin_setting_callback_editlock" it will be fetched with "bbp_form_option", which calls "bbp_get_form_option". Inside this function, there is a check:
if ( empty( $value ) ) { $value = $default; }
"empty" checks, if "$value" is a valid value is set:
https://www.php.net/manual/en/function.empty.php
But "0" will not be accepted as valid, so it applies the "$default" value.
Imho, the shown code should just remove completely.
@johnjamesjacoby: Is this analyzes helpful for you, or do you want more support from people like me?
it is a bug, and I think there is a trac ticket, but I can't immediately find it
I just set it to 5256000 which is ten years - if you're still editing after that, then maybe you need a long hard look at your life :-)