0.2.12 • Published 5 years ago

wp-auto-react v0.2.12

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Wordpress API

Wordpress json data API component, use data from Wordpress in to React without server

Instalation

npm install wp-auto-react

Usage

First save data from Wordpress to JSON files
node node_modules/wordpress-data/index --host http://you.wordpress.site
Still connect to data from React

Include module to React component

import WordpressApi from 'wp-auto-react'

Create element with using data

/*
* @data - Object
* @html - Function
*/
const element = (data, html) => {
	console.log(data); // show needed data
	return <div>
			<div>{data.items[0].title}</div>
			<div>{html(data.items[0].content)}
		</div>
}

Request data from render method

render () {
	return (
		<div>
			<WordpressApi
				get={'POSTS_FOR_ID'} //require property
				items={''} // require for _get_ with _ID
				element={element} // require for all
			 />
		</div>
	);
}
Accepted get methods
POSTS_FOR_ID
PAGES_FOR_ID
CATEGORIES_FOR_ID
POSTS_LISTS
PAGES_LISTS
CATAGORIES_LISTS
ALL_PAGES
ALL_POSTS
ALL_CATEGORIES
0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago