|
Revision 21, 0.8 kB
(checked in by admin, 18 years ago)
|
|
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | class RCCWP_Options |
|---|
| 3 | { |
|---|
| 4 | function Delete() |
|---|
| 5 | { |
|---|
| 6 | delete_option(RC_CWP_OPTION_KEY); |
|---|
| 7 | } |
|---|
| 8 | |
|---|
| 9 | function Update($hideWritePost, $hideWritePage, $promptEditingPost, $assignToRole, $useSnipshot, $defaultCustomWritePanel) |
|---|
| 10 | { |
|---|
| 11 | $options['hide-write-post'] = $hideWritePost; |
|---|
| 12 | $options['hide-write-page'] = $hideWritePage; |
|---|
| 13 | $options['prompt-editing-post'] = $promptEditingPost; |
|---|
| 14 | $options['assign-to-role'] = $assignToRole; |
|---|
| 15 | $options['use-snipshot'] = $useSnipshot; |
|---|
| 16 | $options['default-custom-write-panel'] = $defaultCustomWritePanel; |
|---|
| 17 | |
|---|
| 18 | $options = serialize($options); |
|---|
| 19 | update_option(RC_CWP_OPTION_KEY, $options); |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | function Get($key = null) |
|---|
| 23 | { |
|---|
| 24 | $options = unserialize(get_option(RC_CWP_OPTION_KEY)); |
|---|
| 25 | |
|---|
| 26 | if (!empty($key)) |
|---|
| 27 | return $options[$key]; |
|---|
| 28 | else |
|---|
| 29 | return $options; |
|---|
| 30 | } |
|---|
| 31 | } |
|---|
| 32 | ?> |
|---|