-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Extending page with hook examples #5707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few minor content suggestions as marked.
To help us organize these, I have a thought.
- It'd be nice to get all of this onto the docs sidebar.
- If that can't be done (I doubt it can) I'm going to submit a PR sometime to add them all anyway, CMS/WordPress with all these subpages, then hide them from the sidebar with metadata. This will allow the breadcrumbs we're implementing to work right, which will at least aid people in understanding where they are and how to get back up a level or two.
articles/cms/wordpress/extending.md
Outdated
|
||
This filter is called after the plugin finds the related user to login (based on the auth0 `user_id`) and is used to override the default behaviour with custom matching rules (for example, always match by email). | ||
|
||
If the filter returns null, it will lookup by email as described in the [How does it work?](https://auth0.com/docs/cms/wordpress/how-does-it-work) document. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relative docs URL - [How does it work?](/cms/wordpress/how-does-it-work)
articles/cms/wordpress/extending.md
Outdated
|
||
Actions in WordPress run custom code at specific points during processing. [Learn more about actions here](https://developer.wordpress.org/plugins/hooks/actions/). | ||
|
||
### `auth0_before_login` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For headings that have function names or variables or whatever else we normally don't do the backticks, sometimes formatting can go kind of wonky. Same with the others below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffreylees - For these, I thought it would be handy to have an anchor link and have them stand out a bit. Formatting seems to work:
https://auth0-docs-content-pr-5707.herokuapp.com/docs/cms/wordpress/extending
Any other ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to point this out as well since it is not consistent with the formatting we follow at all docs. We don't use backtips on headers (it doesn't look like a header any longer but some hybrid) so in order to be consistent with the rest of the documentation you have to remove them.
articles/cms/wordpress/extending.md
Outdated
|
||
### `auth0_verify_email_page` | ||
|
||
This filter runs in `WP_Auth0_Email_Verification` to change the HTML rendered when a logging-in user needs to verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...when a user who is logging in needs to...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jet lag grammer 😆
@cocojoe - LGTY? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimise Nexts Steps
@@ -53,3 +53,15 @@ Vydcvl6gpWNeUE | |||
|
|||
- [Cookies vs Tokens. Getting auth right with Angular.JS](https://auth0.com/blog/2014/01/07/angularjs-authentication-with-cookies-vs-token/) | |||
- [10 Things You Should Know about Tokens](https://auth0.com/blog/2014/01/27/ten-things-you-should-know-about-tokens-and-cookies/) | |||
|
|||
## Keep Reading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than repeating this lots of times in 5 files, can it be turned into an include? I don't really mind if the current section is included in the next-steps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cocojoe - I'll add it to my list for the next go-around, I have a number of things that need improving.
OK to approve for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, we don't include in one doc links that point to the same doc. We have them reported back as broken links (it has happened more than once). So if you do use a doc fragment at some point make sure that the same doc does not list itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to Unify the next steps in the near future.
@mpaktiti - Ready for you! I've got a release waiting (Monday at the earliest). Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments. This also needs an update feed entry since it's a new doc.
@@ -297,4 +297,5 @@ For more information on the Login by Auth0 WordPress Plugin, follow these links. | |||
* [Installation](/cms/wordpress/installation) | |||
* [JWT Authentication](/cms/wordpress/jwt-authentication) | |||
* [Troubleshoot](/cms/wordpress/troubleshoot) | |||
* [Extension](/cms/wordpress/extension) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link throws a 404. This should match the name of the file (so either the links will be /cms/wordpress/extending
or the new file will be named extension.md
.
articles/cms/wordpress/index.md
Outdated
* [JWT Authentication](/cms/wordpress/jwt-authentication) | ||
* [Troubleshoot](/cms/wordpress/troubleshoot) | ||
* [Extending](/cms/wordpress/extending) | ||
::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This element should hold tops 5 items (design rules), so one has to go. Also, consider more descriptive names (for example Install the plugin
instead of Installation
)
@@ -65,4 +65,5 @@ Now you're ready to [Configure](/cms/wordpress/configuration)! | |||
* [How does it work?](/cms/wordpress/how-does-it-work) | |||
* [JWT Authentication](/cms/wordpress/jwt-authentication) | |||
* [Troubleshoot](/cms/wordpress/troubleshoot) | |||
* [Extension](/cms/wordpress/extension) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404
articles/cms/wordpress/extending.md
Outdated
description: How to extend the Login by Auth0 WordPress Plugin with hooks, filters, and functions. | ||
--- | ||
|
||
# Extending Login by Auth0 WordPress Plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a the
is missing here, "Extending the Login WordPress Plugin"
@@ -0,0 +1,228 @@ | |||
--- | |||
description: How to extend the Login by Auth0 WordPress Plugin with hooks, filters, and functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add metadata toc: true
more info https://github.com/auth0/docs/blob/master/CONTRIBUTING.md#front-matter
articles/cms/wordpress/extending.md
Outdated
|
||
Actions in WordPress run custom code at specific points during processing. [Learn more about actions here](https://developer.wordpress.org/plugins/hooks/actions/). | ||
|
||
### `auth0_before_login` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to point this out as well since it is not consistent with the formatting we follow at all docs. We don't use backtips on headers (it doesn't look like a header any longer but some hybrid) so in order to be consistent with the rest of the documentation you have to remove them.
articles/cms/wordpress/extending.md
Outdated
|
||
We're happy to review and approve new filters and actions that help you integrate even further in this plugin. Please | ||
see the Contributing section on the [GitHub repo readme for this plugin](https://github.com/auth0/wp-auth0/blob/master/README.md). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to stop and think for a bit here when I first read this intro. It feels like there is a short paragraph missing at the start explaining what this doc is about (start with sth like "You can create new filters and actions for your Auth0 WordPress Plugin......."). Also this doc lists a set of actions and filters so you should also talk about this in the intro (I had to scroll to see what this doc is about). So if this doc is listing the existing filters and actions say so at the beginning.
} | ||
add_filter( 'auth0_login_css', 'a0_docs_ex_auth0_login_css' ); | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing a header before the next-steps element
@@ -53,3 +53,15 @@ Vydcvl6gpWNeUE | |||
|
|||
- [Cookies vs Tokens. Getting auth right with Angular.JS](https://auth0.com/blog/2014/01/07/angularjs-authentication-with-cookies-vs-token/) | |||
- [10 Things You Should Know about Tokens](https://auth0.com/blog/2014/01/27/ten-things-you-should-know-about-tokens-and-cookies/) | |||
|
|||
## Keep Reading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, we don't include in one doc links that point to the same doc. We have them reported back as broken links (it has happened more than once). So if you do use a doc fragment at some point make sure that the same doc does not list itself.
@mpaktiti - Thanks for the thorough review! All items have been addressed. One question ... the main reason for the backtick headers was to be able to link directly to specific hooks here in the doc. I don't see anything in the contrib doc about anchor links. Is it possible to do that? |
@joshcanhelp You should use H3 and remove the backticks, this way we will have anchors plus they will be listed in the |
@mpaktiti - Ready to go! |
We've got documentation all over and this is a first step towards consolidating on auth0.com/docs. This new page replaces the examples that are currently on the repo README page (removed on the next release) with tested, documented examples. I also cleaned up the "read more" links at the end of each article.