Sub Promotion

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제
Extra Form
제목 franklynstrempel@mailsent.net
예약자 14|@|5495|@|17060
Headless WordPress is an idea that is being used more and more actively among developers. I will try to disclose several topics related to this approach. In particular, I will show how to implement application login using JWT. We will create a simple application that will allow users to log in using their username. After logging in, we will display the user his data. To implement login to the application using JWT, we need to install and activate the JWT Authentication for WP REST API plugin . Application Preparation Let's create our own React app using the Create React App . We open the terminal (command line) and go to the directory in which the application will be developed. Then use the command: 01 npx create-react-app my-app Here you can replace my-app with your name. This will be your directory in which all the code will be stored. I decided to name the headless directory. Then browse to this folder. You can start the application now using the npm start command. However, let's first install Gutenberg Components, the npm package @ wordpress / components. This will allow us to use various components in our application. Install Gutenberg Components using the command 01 npm install @wordpress/components Since the Gutenberg Components package does not include markup classes, we can create our own CSS style guide or use the existing style frameworks so as not to waste our time on this. If you want to create an application that will be used in production - be sure to think about creating your own CSS markup. We will use Bootstrap 4 for styles. You can install it using the command: 01 npm install bootstrap We also need SASS processing (SCSS), so we need our application to be able to process such files. To do this, use the following command: 01 npm install node-sass --save Since we will use the Bootstrap and Gutenberg styles, we can remove App.css and create App.scss. Put the following inside this new file: 01 @import '~bootstrap/scss/bootstrap.scss'; 02 03 @import '~@wordpress/components/build-style/style.css'; Now it will be compiled into a CSS file that will include both Boostrap and Gutenberg styles. We will need to fulfill POST and GET requests to our WordPress site, so we need a way to implement this. You can use fetch from the browser API, or a library. We will use the axios library. It is installed using the command 01 npm install axios Add login logic to our Headless WordPress Open App.js to start adding login logic. We will check whether the user is logged in or not. If not, we will show the login form. Otherwise, the console will be displayed. Let's adjust all the imports in the application: 01 import React, useState, useEffect from 'react'; 02 import './App.scss'; 03 import '@wordpress/components/build-style/style.css'; 04 import Login from './components/Login'; 05 import Dashboard from './components/Dashboard'; Do not worry about errors that appear. The Dashboard and Login components do not exist yet, therefore you may receive compilation errors. Now we can replace the App function with the following: 01 function App() 02 const [login, setLogin] = useState( '' ); 03 const siteURL = 'yoursite_here'; 04 05 useEffect(() => 06 const localLogin = localStorage.getItem('login'); 07 // If we have logged in, v2.0.1 - Download Sortable Video Embed – WordPress Plugin Nulled 2.0.0 set it.

08 if ( localLogin ) 09 v.7.0.1 Woocommerce Step Filter demo setLogin( localLogin ); 10 11 , [login]); 12 13 return ( 14 15
16 17

Headless WordPress

18 19 20 login && 21 22 23 ! login && 24 25 26
27 28 ); 29 What we did here: v.1.4.6 YITH Live Chat Full Download We used React useState hooks to globally process login Avenus Music One Page Modern Elementor Elite Video Player Nulled WordPress Theme Nulled information. We used useEffect hooks to handle changes during the login process.

List of Articles
번호 제목 글쓴이 최근 수정일 날짜
54106 brigida.crosby@gmail.com Brigida9559541724223 2020.06.09 2020.06.09
54105 susielockyer@googlemail.com SusieKzr45439996 2020.06.09 2020.06.09
54104 cristineheard@care2.com CristineHeard9905 2020.06.09 2020.06.09
54103 chancefolingsby@googlemail.com ChanceFolingsby87 2020.06.09 2020.06.09
54102 buddyeaton@web.de BuddyEaton3254884711 2020.06.09 2020.06.09
54101 wolfgang.mccart@arcor.de Wolfgang99V67967 2020.06.09 2020.06.09
54100 martywaxman@yepmail.net MartyWaxman23253 2020.06.09 2020.06.09
» franklynstrempel@mailsent.net FranklynC69579821 2020.06.09 2020.06.09
54098 beatrisdunford@freenet.de BeatrisEyv01496888371 2020.06.09 2020.06.09
54097 kathleen.rymer@gmail.com Kathleen63X6757313580 2020.06.09 2020.06.09
54096 kaleydale@inbox.com KaleyDale3421554597 2020.06.09 2020.06.09
54095 blythe.mettler@t-online.de BlytheMettler3492 2020.06.09 2020.06.09
54094 teshasison@arcor.de CPOTesha04902820 2020.06.09 2020.06.09
54093 cheryl.dahlenburg@inbox.com CherylDahlenburg 2020.06.09 2020.06.09
54092 rosalindasani@t-online.de RosalindaSani89064 2020.06.09 2020.06.09
54091 kaleydale@inbox.com KaleyDale3421554597 2020.06.09 2020.06.09
54090 dallasgatehouse@bigstring.com DallasGatehouse 2020.06.09 2020.06.09
54089 effiecrump@hotmail.com EffieCrump527398344 2020.06.09 2020.06.09
54088 latishabrubaker@gmail.com LatishaBrubaker13752 2020.06.09 2020.06.09
54087 ameliaburdett@inbox.com Amelia05N1837665432 2020.06.09 2020.06.09
54086 rosaforney@live.de RosaForney40333078 2020.06.09 2020.06.09
54085 maxmullan@freenet.de MaxMullan191980618791 2020.06.09 2020.06.09
54084 kelleedeasey@gmail.com KelleeDeasey17985143 2020.06.09 2020.06.09
54083 natishacrenshaw@internet-mail.org NatishaCrenshaw31 2020.06.09 2020.06.09
54082 belle.kater@live.de BelleKater267920 2020.06.09 2020.06.09
54081 jeannaconnah@gmail.com JeannaConnah171812 2020.06.09 2020.06.09
54080 ismaelbanvard@peacemail.com IsmaelBanvard6536238 2020.06.09 2020.06.09
54079 opalrodarte@gmail.com OpalRodarte6730246 2020.06.09 2020.06.09
54078 daniel.lorenzini@bigstring.com DanielLorenzini 2020.06.09 2020.06.09
54077 kandivrooman@ssl-mail.com KandiVrooman72588937 2020.06.09 2020.06.09
54076 maisieloving@arcor.de MaisieLoving025141 2020.06.09 2020.06.09
54075 beawolcott@yahoo.com BeaWolcott757808918 2020.06.09 2020.06.09
54074 rashadwhittemore@bigstring.com RashadWhittemore5 2020.06.09 2020.06.09
54073 jackson.pawsey@gmail.com JacksonPawsey670 2020.06.09 2020.06.09
54072 donnajordon@googlemail.com DonnaJordon5250 2020.06.09 2020.06.09
54071 christine_huhn@gmail.com ChristineHuhn49035 2020.06.09 2020.06.09
54070 genevieveepstein@live.de GenevieveW25765188340 2020.06.09 2020.06.09
54069 paulinelangley@gmail.com PaulineLangley27 2020.06.09 2020.06.09
54068 charmaingowins@web.de CharmainGowins35 2020.06.09 2020.06.09
54067 emmairby@wildmail.com EmmaIrby03336478376 2020.06.09 2020.06.09
54066 kaleydale@inbox.com KaleyDale3421554597 2020.06.09 2020.06.09
54065 kariduvall@web.de KariDuvall68012 2020.06.09 2020.06.09
54064 robertodun@gmail.com RobertoDun801259790 2020.06.09 2020.06.09
54063 collinberrios@bigstring.com CollinBerrios440086 2020.06.09 2020.06.09
54062 milfordholliday@freenet.de MilfordHolliday 2020.06.09 2020.06.09
54061 lillie_lynch@gmail.com LillieLynch9312 2020.06.09 2020.06.09
54060 jefferey.shang@gmail.com Jefferey54X3565650179 2020.06.09 2020.06.09
54059 lori_holte@gmail.com LoriHolte026698762 2020.06.09 2020.06.09
54058 adriennelaycock@hotmail.de AdrienneLaycock6730 2020.06.09 2020.06.09
54057 shelafison@gmail.com ShelaFison7898197506 2020.06.09 2020.06.09
Board Pagination Prev 1 ... 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 ... 4736 Next
/ 4736

bodum2ro 43,sejong, Korea / Copyrightⓒ. All Rights Reserved By fone

© k2s0o1d4e0s2i1g5n. All Rights Reserved