Skip to content

Commit

Permalink
ACF, and API endpoints that were in Axe
Browse files Browse the repository at this point in the history
  • Loading branch information
adampatterson committed Dec 3, 2016
1 parent dd76eae commit 00f16c6
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/_design/
/.idea
.sass-cache
/vendor
/assets/vendor
/node_modules
Empty file added acf-json/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {

}
}
14 changes: 4 additions & 10 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<?php
// For composer dependencies
require 'vendor/autoload.php';

require_once( 'lib/init.php' );
require_once( 'lib/custom.php' );

// Custom admin login logo
function custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image: url(' . get_bloginfo( 'template_directory' ) . '/assets/img/adminlogo.png) !important; height: auto;}
body.login{ background: #fff; }
</style>';
}

add_action( 'login_head', 'custom_login_logo' );
require_once( 'lib/theme-api.php' );
require_once( 'lib/theme-rewrite.php' );

/*
add_filter('acf/settings/load_json', function($paths) {
Expand Down
10 changes: 10 additions & 0 deletions lib/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
/****************************************
* Misc Theme Functions
*****************************************/

// Custom admin login logo
function custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image: url(' . get_bloginfo( 'template_directory' ) . '/assets/img/adminlogo.png) !important; height: auto;}
body.login{ background: #fff; }
</style>';
}

add_action( 'login_head', 'custom_login_logo' );
27 changes: 27 additions & 0 deletions lib/theme-api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
namespace Axe;

class AxeAPI
{

public function __construct()
{
// http://v2.wp-api.org/extending/adding/
add_action('rest_api_init', function () {
register_rest_route('axe', '/sample', array(
'methods' => 'GET',
'callback' => array(
$this,
'sampleEndPoint'
),
));
});
}

public function sampleEndPoint()
{
return ['one', 'two'];
}
}

new AxeAPI;

0 comments on commit 00f16c6

Please sign in to comment.