Skip to content
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

Merged
merged 8 commits into from
Feb 27, 2018
Merged

Conversation

joshcanhelp
Copy link
Contributor

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.

@solepano solepano temporarily deployed to auth0-docs-content-pr-5707 February 8, 2018 17:58 Inactive
Copy link
Contributor

@jeffreylees jeffreylees left a 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.

  1. It'd be nice to get all of this onto the docs sidebar.
  2. 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.


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.
Copy link
Contributor

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)


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`
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.


### `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
Copy link
Contributor

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Jet lag grammer 😆

@solepano solepano temporarily deployed to auth0-docs-content-pr-5707 February 13, 2018 14:04 Inactive
@joshcanhelp
Copy link
Contributor Author

@cocojoe - LGTY?

Copy link
Member

@cocojoe cocojoe left a 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
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

I guess

Copy link
Contributor

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.

Copy link
Member

@cocojoe cocojoe left a 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.

@joshcanhelp
Copy link
Contributor Author

@mpaktiti - Ready for you! I've got a release waiting (Monday at the earliest). Thank you!

Copy link
Contributor

@mpaktiti mpaktiti left a 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)
Copy link
Contributor

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.

* [JWT Authentication](/cms/wordpress/jwt-authentication)
* [Troubleshoot](/cms/wordpress/troubleshoot)
* [Extending](/cms/wordpress/extending)
:::
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

404

description: How to extend the Login by Auth0 WordPress Plugin with hooks, filters, and functions.
---

# Extending Login by Auth0 WordPress Plugin
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

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


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`
Copy link
Contributor

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.


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).

Copy link
Contributor

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' );
```

Copy link
Contributor

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
Copy link
Contributor

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.

@solepano solepano temporarily deployed to auth0-docs-content-pr-5707 February 26, 2018 16:39 Inactive
@joshcanhelp
Copy link
Contributor Author

@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?

@solepano solepano temporarily deployed to auth0-docs-content-pr-5707 February 26, 2018 16:50 Inactive
@mpaktiti
Copy link
Contributor

@joshcanhelp You should use H3 and remove the backticks, this way we will have anchors plus they will be listed in the In this Article dropdown at the top right for easy access (this was added due to the toc metadata you set). The rest of the changes look good to go 👍

@joshcanhelp
Copy link
Contributor Author

@mpaktiti - Ready to go!

@mpaktiti mpaktiti merged commit 83ecc39 into master Feb 27, 2018
@mpaktiti mpaktiti deleted the joshc-adding-wp-extend branch February 27, 2018 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants