/ p o s t s ? f i l t e r [ s ] = w o rd p re s s ɹ ɹ ʮ Wo rd P re s s ʯ Λ ؚ Ή ߘ Λ औ ಘ P O S T w p - j s o n / c o m m e n t s / 1 2 3 - d “ c o n t e n t = c o m m e n t ” ɹ ɹ I D : 1 2 3 ͷ ه ࣄ ʹ ί ϝ ϯ τ Λ ߘ
o s t s > ύ ϥϝ ʔ λ σ ϑ Υϧ τ આ ໌ a p i - ro o t A P I ͷ U R L Λ ࢦ ఆ p o s t - t y p e ߘ λ Π ϓ Λ ࢦ ఆ p e r- p a g e 1 0 औ ಘ ͢ Δ ه ࣄ ݅ o ff s e t 0 εΩ οϓ ͢ Δ ه ࣄ ݅ p o s t - i d ه ࣄ I D Λ ࢦ ఆ f i l t e r W P _ Q u e r y ϥ ΠΫ ͳ Ϋ Τ Ϧ
A P I + I o n i c F r a m e w o r k $ ionic start myApp https://github.com/miya0001/ionic- starter-wordpress $ cd myApp $ ionic platform add ios $ ionic platform add android
n g u l a r j s <ion-view title="͓Βͤ"><ion-content> <have-posts api-root="{{ apiRoot }}" post-type="posts" offset="0" per-page="5"> <the-post-thumbnail href="#/app/posts/:id" size=“post-thumbnail”> </the-post-thumbnail> <h2 class="entry-title"><the-title href="#/app/posts/:id"></the-title></h1> <the-date format="yyyy/MM/dd"></the-date> </have-posts> </ion-content></ion-view> https://github.com/ogijima-library/app/blob/master/www/templates/posts.html
ͷ u r l Λ W P ɹ A P I ʹ ReactDOM.render( - <CommentBox url="/api/comments" pollInterval={2000} />, + <CommentBox url="http://api.wp-app.org/wp-json/ wp/v2/comments" pollInterval={2000} />, document.getElementById('content') );
r k d o w n ର Ԡ Λ Φ ϑ ʹ var Comment = React.createClass({ rawMarkup: function() { - var md = new Remarkable(); - var rawMarkup = md.render(this.props.children.toString()); - return { __html: rawMarkup }; + return { __html: this.props.children.toString()}; },
t Λ W P A P I ର Ԡ render: function() { var commentNodes = this.props.data.map(function(comment) { return ( - <Comment author={comment.author} key={comment.id}> - {comment.text} + <Comment author={comment.author_name} key={comment.id}> + {comment.content.rendered} </Comment> ); });