Permalink
Browse files

Setting the option name

  • Loading branch information...
ionofzion committed Nov 2, 2018
1 parent 6c923ff commit 1f6613b5b440ff1ce368d472814294429198e81b
Showing with 5 additions and 5 deletions.
  1. +3 −3 includes/Endpoint/Example.php
  2. +1 −1 includes/Plugin.php
  3. +1 −1 uninstall.php
@@ -117,7 +117,7 @@ public function register_routes() {
* @return WP_Error|WP_REST_Request
*/
public function get_example( $request ) {
$example_option = get_option( 'wpr_example_setting' );
$example_option = get_option( 'wpr_contact_email' );
// Don't return false if there is no option
if ( ! $example_option ) {
@@ -140,7 +140,7 @@ public function get_example( $request ) {
* @return WP_Error|WP_REST_Request
*/
public function update_example( $request ) {
$updated = update_option( 'wpr_example_setting', $request->get_param( 'exampleSetting' ) );
$updated = update_option( 'wpr_contact_email', $request->get_param( 'exampleSetting' ) );
return new \WP_REST_Response( array(
'success' => $updated,
@@ -155,7 +155,7 @@ public function update_example( $request ) {
* @return WP_Error|WP_REST_Request
*/
public function delete_example( $request ) {
$deleted = delete_option( 'wpr_example_setting' );
$deleted = delete_option( 'wpr_contact_email' );
return new \WP_REST_Response( array(
'success' => $deleted,
@@ -74,7 +74,7 @@ public function get_plugin_version() {
* @since 1.0.0
*/
public static function activate() {
add_option( 'wpr_example_setting' );
add_option( 'wpr_contact_email' );
}
/**
@@ -3,4 +3,4 @@
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
exit();
delete_option( 'wpr_example_setting' );
delete_option( 'wpr_contact_email' );

0 comments on commit 1f6613b

Please sign in to comment.