Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Hook Docs for lib/endpoints/class-wp-rest-users-controller.php #1556

Conversation

adamsilverstein
Copy link

See #1549.

  • Add some missing hook docs
  • Spacing, punctuation cleanup as per standard
  • Change second do_action from rest_insert_user to rest_update_user as
    its in the update function
  • added some todo notes, I don’t understand what the final false
    variable is for, maybe its needed?

* Add some missing filter docs
* Spacing, punctuation cleanup as per standard
* Change second action from `rest_insert_user` to `rest_update_user` as
its in the update function
* added some todo notes, I don’t understand what the final false
variable is for, maybe its needed?
* @param WP_REST_Request $request Request object.
* @param bool $bool A boolean that is false.
* @param bool $bool A boolean that is false.
* @todo remove final bool = false variable, unused?
*/
do_action( 'rest_insert_user', $user, $request, false );
Copy link
Member

Choose a reason for hiding this comment

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

@adamsilverstein The third param here should be true on "Create" (it should be false on update).

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for clarifying, I will add that info to the docblock

@adamsilverstein
Copy link
Author

Note: I believe this also corrects an issue with the first call of the rest_insert_user filter inside create_item, I changed the last ("created") parameter to true as per @rachelbaker's comment on my previous commit (#1556 (comment)).

Please confirm this is correct before merging :)

@adamsilverstein
Copy link
Author

Working on lib/endpoints/class-wp-rest-terms-controller.php now and wondering why I don't see similar do_action( 'rest_insert_term' ...) hooks firing. Is this intentional, or an oversight? If the latter I can go ahead and add them as I go :)

@rachelbaker
Copy link
Member

Working on lib/endpoints/class-wp-rest-terms-controller.php now and wondering why I don't see similar do_action( 'rest_insert_term' ...) hooks firing. Is this intentional, or an oversight? If the latter I can go ahead and add them as I go :)

@adamsilverstein Just an oversight.

@@ -2,3 +2,5 @@
composer.lock
node_modules
vendor

.idea/
Copy link
Member

Choose a reason for hiding this comment

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

@adamsilverstein can you undo this change to the .gitignore?

Copy link
Author

Choose a reason for hiding this comment

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

Ugh, should be in my local exclude sorry. kind of switching back to sublime anyway :)

Copy link
Author

Choose a reason for hiding this comment

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

Removed.

@adamsilverstein
Copy link
Author

@rachelbaker This should be good to go unless I missed some feedback, I'm addressing adding missing hooks in #1571

@rmccue rmccue added this to the 2.0 Beta 5 milestone Sep 22, 2015
@rmccue rmccue self-assigned this Sep 22, 2015
rmccue added a commit that referenced this pull request Sep 22, 2015
…t-users-controller-php

Hook Docs for lib/endpoints/class-wp-rest-users-controller.php
@rmccue rmccue merged commit 46aa51f into WP-API:develop Sep 22, 2015
@rmccue
Copy link
Member

rmccue commented Sep 22, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants