Skip to content

Add REST save for dashboard notification settings#71

Open
altis-assistant wants to merge 1 commit into
humanmade:masterfrom
altis-assistant:add-dashboard-widget-rest-save
Open

Add REST save for dashboard notification settings#71
altis-assistant wants to merge 1 commit into
humanmade:masterfrom
altis-assistant:add-dashboard-widget-rest-save

Conversation

@altis-assistant
Copy link
Copy Markdown

Summary

  • Add a falcon/v1/notification-settings REST endpoint for saving the current user’s notification settings on the current site.
  • Require an authenticated user with read capability and Falcon enabled for the current site.
  • Turn the dashboard widget into a working form that saves via the REST API using the WP REST nonce.

Testing

  • git diff --check
  • Not run: php -l / PHP tests, because PHP is not installed in this container.

Comment on lines +166 to +168
// Falcon_Connector::save_profile_settings() expects the same mangled
// field names PHP creates for normal form submissions.
$args[ str_replace( '.', '_', $key ) ] = $value;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a helper method might be useful to codify the convention/

@svandragt
Copy link
Copy Markdown

@altis-assistant help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants