Em Andamento

Write PHP function to return JSON after WP_Query and re-order / total some data

In WordPress I have a custom post type. In each post of this custom post type is a custom field named "report" this custom field (post meta field) stores a JSON blob which is an array of objects (JSON)

An example of the JSON is below, this is stored in the post meta / custom field of the custom post type.

[{"entrances":"1","ga:date":"20080918","ga:landingPagePath":"/","ga:sourceMedium":"aol / organic","pageviews":"5","sessions":"1","totalValue":"0.0","transactionRevenue":"0.0","transactions":"0","transactionsPerSession":"0.0","uniquePurchases":"0"},{"entrances":"1","ga:date":"20080918","ga:landingPagePath":"/[url removed, login to view]","ga:sourceMedium":"aol / organic","pageviews":"7","sessions":"1","totalValue":"0.0","transactionRevenue":"0.0","transactions":"0","transactionsPerSession":"0.0","uniquePurchases":"0"}]

Note that one report for one day has multiple JSON objects with different pageview entries

Your job is to create a PHP function which uses WP_Query, to query all of the posts from the custom post type between two dates. So $query = new WP_Query('posts_per_page -1 etc...... To query dates you will use [url removed, login to view]

Now for each post which is returned. The PHP function will get all post meta reports. Then return total pageviews per day. And return JSON which is array of arrays, the first value is day, the second is total pageviews for that date

{

"total_pageviews": [

[20080918, 10],

[20080919, 52]

]

}

I have a few more similar projects to format JSON data I hope to have this completed very soon thank you

Habilidades: PHP, WordPress

Ver mais: php api return json, write php query smarty, php function order

Acerca do Empregador:
( 5 comentários ) Mount Sinai, United States

ID do Projeto: #14799323

Premiar a:

ravichedwal

hello sir i am very good php developer i have dene lots of work in rest and soap api thanks Relevant Skills and Experience hello sir i am very good php developer i have dene lots of work in rest and soap api tha Mais

$20 USD em 1 dia
(47 Avaliações)
5.5

8 freelancers estão ofertando em média $28 para este trabalho

maverik902

I have experience in making these kind of websites and has many satisfied clients. Will provide example websites on request. mynextech.com/weeple Relevant Skills and Experience HTML, CSS, WORDPRESS AND PHP Proposed M Mais

$25 USD em 1 dia
(73 Comentários)
6.0
liangjongai

Hi, sir I have a great skill in wordpress. I'm sure I can complete your project. My price and period is negotiable. We can discuss the details via chat. Thanks. Relevant Skills and Experience I have been developing f Mais

$25 USD em 1 dia
(60 Comentários)
5.3
abbalove

Hey, can you give me sample data in database to make it ? Rocky .

$35 USD em 1 dia
(25 Comentários)
4.4
$50 USD em 1 dia
(4 Comentários)
3.2
$15 USD em 1 dia
(14 Comentários)
3.4
$25 USD em 1 dia
(0 Comentários)
0.0
deep749mama

I’ve carefully gone through your job posting. I ’m an expert HTML/CSS, wordpress, core php , laravel, codeigniter developer with more than 4 years experiences Relevant Skills and Experience I ’m an expert HTML/CSS, wo Mais

$25 USD em 1 dia
(0 Comentários)
0.0