File manager - Edit - /home/verseaumee/maze/wp-content/plugins/reddit-for-woocommerce/js/src/hooks/useRedditAuthorization.js
Back
/** * External dependencies */ import { useMemo } from '@wordpress/element'; import { addQueryArgs } from '@wordpress/url'; /** * Internal dependencies */ import { API_NAMESPACE } from '~/data/constants'; import useApiFetchCallback from './useApiFetchCallback'; /** * Request a Reddit Oauth URL. * * @param {'setup'|'reconnect'} nextPageName Indicates the next page name mapped to the redirect URL when back from Reddit authorization. * @return {Array} The same structure as `useApiFetchCallback`. */ export default function useRedditAuthorization( nextPageName ) { const fetchOption = useMemo( () => { const query = { next_page_name: nextPageName }; const path = addQueryArgs( `${ API_NAMESPACE }/reddit/connect`, query ); return { path }; }, [ nextPageName ] ); return useApiFetchCallback( fetchOption ); }
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings