Skip to content

Commit

Permalink
soon to work on sample API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
adampatterson committed May 1, 2019
1 parent 733aff8 commit 54658e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
require_once('lib/init.php');
require_once('lib/custom.php');
require_once('lib/theme-helpers.php');
require_once('lib/theme-media.php');

require_once('lib/theme-api.php');
require_once('lib/theme-rewrite.php');
require_once('lib/theme-media.php');

/*

add_filter('acf/settings/load_json', function($paths) {
$paths = array(get_template_directory() . '/acf-json');

Expand All @@ -23,7 +24,6 @@

return $paths;
});
*/

/*
* Used to clear the permalinks so that the custom rewrite rules will work.
Expand Down
1 change: 1 addition & 0 deletions lib/theme-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class HandleAPI {

public function __construct() {
// http://wordpress.local/wp-json/axe
// http://v2.wp-api.org/extending/adding/
add_action( 'rest_api_init', function () {
register_rest_route( 'axe', '/sample', array(
Expand Down
5 changes: 3 additions & 2 deletions templates/template-inventory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php
$data = get_fields();
$post = get_post();
$stock_number = get_query_var('vehicle_id', 0);

include(get_template_part_acf('templates/partials/header'));

echo '<!-- template: index/no_posts -->'; ?>
echo '<!-- template: template/template-inventory -->'; ?>

<div class="wrapper">
<div class="container">
Expand All @@ -16,7 +17,7 @@
<h1>Works!</h1>
<p><?= 'This vehicle has the ID of ' . $stock_number; ?></p>
<?php
var_dump(Handle\HandleRewrites::test_variables())
dd(Handle\HandleRewrites::test_variables())
?>
</article>
</section>
Expand Down

0 comments on commit 54658e7

Please sign in to comment.