Skip to content

Commit

Permalink
Update docs for 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishutchinson committed Sep 17, 2015
1 parent b5b1aa0 commit a6181d3
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 32 deletions.
10 changes: 6 additions & 4 deletions docs/classes/ACFtoWPAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1776467203"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1228078457"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1776467203" class="accordion-body collapse in">
<div id="namespace-1228078457" class="accordion-body collapse in">
<div class="accordion-inner">


Expand Down Expand Up @@ -167,7 +167,7 @@ <h1><small>\</small>ACFtoWPAPI</h1>
Description: Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the &#039;acf&#039; key
Author: Chris Hutchinson
Author URI: http://www.chrishutchinson.me
Version: 1.3.0
Version: 1.3.2
Plugin URI: https://wordpress.org/plugins/acf-to-wp-api/</em></p>


Expand Down Expand Up @@ -554,6 +554,7 @@ <h2>Tags</h2>
since
</th>
<td>
1.3.2 <p>Adds support for pages and public custom post types</p>
1.3.0
</td>
</tr>
Expand Down Expand Up @@ -950,6 +951,7 @@ <h2>Tags</h2>
since
</th>
<td>
1.3.1 <p>Switched to array() notation (over [] notation) to support PHP &lt; 5.4</p>
1.3.0
</td>
</tr>
Expand Down Expand Up @@ -1579,7 +1581,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down
8 changes: 4 additions & 4 deletions docs/files/acf-to-wp-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-46906488"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-551050294"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-46906488" class="accordion-body collapse in">
<div id="namespace-551050294" class="accordion-body collapse in">
<div class="accordion-inner">


Expand Down Expand Up @@ -175,7 +175,7 @@ <h2>Classes</h2>
Description: Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the &#039;acf&#039; key
Author: Chris Hutchinson
Author URI: http://www.chrishutchinson.me
Version: 1.3.0
Version: 1.3.2
Plugin URI: https://wordpress.org/plugins/acf-to-wp-api/</em></td>
</tr>
</table>
Expand Down Expand Up @@ -247,7 +247,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down
50 changes: 39 additions & 11 deletions docs/files/acf-to-wp-api.php.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the 'acf' key
* Author: Chris Hutchinson
* Author URI: http://www.chrishutchinson.me
* Version: 1.3.0
* Version: 1.3.2
* Plugin URI: https://wordpress.org/plugins/acf-to-wp-api/
*/

Expand Down Expand Up @@ -35,7 +35,7 @@ class ACFtoWPAPI {
$this->plugin->name = 'acf-to-wp-api';
$this->plugin->folder = WP_PLUGIN_DIR . '/' . $this->plugin->name;
$this->plugin->url = WP_PLUGIN_URL . '/' . str_replace(basename( __FILE__), "", plugin_basename(__FILE__));
$this->plugin->version = '1.3.0';
$this->plugin->version = '1.3.2';

$this->apiVersion = get_option( 'rest_api_plugin_version', get_option( 'json_api_plugin_version', null ) );

Expand All @@ -49,7 +49,6 @@ class ACFtoWPAPI {
$this->_versionTwoSetup();
}
}

/**
* Die and dump
*
Expand Down Expand Up @@ -213,9 +212,11 @@ class ACFtoWPAPI {
*
* @return void
*
* @since 1.3.2 Adds support for pages and public custom post types
* @since 1.3.0
*/
function addACFDataPostV2() {
// Posts
register_api_field( 'post',
'acf',
array(
Expand All @@ -224,6 +225,32 @@ class ACFtoWPAPI {
'schema' => null,
)
);

// Pages
register_api_field( 'page',
'acf',
array(
'get_callback' => array( $this, 'addACFDataPostV2cb' ),
'update_callback' => null,
'schema' => null,
)
);

// Public custom post types
$types = get_post_types(array(
'public' => true,
'_builtin' => false
));
foreach($types as $key => $type) {
register_api_field( $type,
'acf',
array(
'get_callback' => array( $this, 'addACFDataPostV2cb' ),
'update_callback' => null,
'schema' => null,
)
);
}
}

/**
Expand Down Expand Up @@ -397,22 +424,23 @@ class ACFtoWPAPI {
*
* @return void
*
* @since 1.3.1 Switched to array() notation (over [] notation) to support PHP < 5.4
* @since 1.3.0
*/
function addACFOptionRouteV2() {
register_rest_route( 'wp/v2/acf', '/options', [
'methods' => [
register_rest_route( 'wp/v2/acf', '/options', array(
'methods' => array(
'GET'
],
),
'callback' => array( $this, 'addACFOptionRouteV2cb' )
] );
) );

register_rest_route( 'wp/v2/acf', '/options/(?P<option>.+)', [
'methods' => [
register_rest_route( 'wp/v2/acf', '/options/(?P<option>.+)', array(
'methods' => array(
'GET'
],
),
'callback' => array( $this, 'addACFOptionRouteV2cb' )
] );
) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/graphs/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-464008308"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2083656335"></a>
<a href="namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-464008308" class="accordion-body collapse in">
<div id="namespace-2083656335" class="accordion-body collapse in">
<div class="accordion-inner">


Expand Down Expand Up @@ -125,7 +125,7 @@ <h2>Classes</h2>
Description: Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the &#039;acf&#039; key
Author: Chris Hutchinson
Author URI: http://www.chrishutchinson.me
Version: 1.3.0
Version: 1.3.2
Plugin URI: https://wordpress.org/plugins/acf-to-wp-api/</em></td>
</tr>
</table>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down
8 changes: 4 additions & 4 deletions docs/namespaces/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-857170042"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1614830885"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-857170042" class="accordion-body collapse in">
<div id="namespace-1614830885" class="accordion-body collapse in">
<div class="accordion-inner">


Expand Down Expand Up @@ -125,7 +125,7 @@ <h2>Classes</h2>
Description: Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the &#039;acf&#039; key
Author: Chris Hutchinson
Author URI: http://www.chrishutchinson.me
Version: 1.3.0
Version: 1.3.2
Plugin URI: https://wordpress.org/plugins/acf-to-wp-api/</em></td>
</tr>
</table>
Expand Down Expand Up @@ -182,7 +182,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/reports/deprecated.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down
4 changes: 2 additions & 2 deletions docs/reports/errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h3>
</tr>
<tr>
<td>error</td>
<td>497</td>
<td>525</td>
<td>Argument $routes is missing from the Docblock of registerRoutes</td>
</tr>
</tbody>
Expand Down Expand Up @@ -170,7 +170,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down
2 changes: 1 addition & 1 deletion docs/reports/markers.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h1><i class="icon-pushpin"></i></h1>
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on August 31st, 2015 at 10:10.
on September 17th, 2015 at 11:59.
</section>
</section>
</section>
Expand Down

0 comments on commit a6181d3

Please sign in to comment.