Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updates to namespace and function naming
  • Loading branch information
Lewis Donovan committed Jul 26, 2017
1 parent 78d9820 commit 701cc7f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
17 changes: 11 additions & 6 deletions index.php
@@ -1,11 +1,16 @@
<?php
/*
Plugin Name: ACF Fields to WP REST API
Plugin URI: https://github.com/lewisdonovan/acf-fields-to-wp-rest-api
Description: Programmatically add data from Advanced Custom Fields to the Wordpress REST API
Author: Lewis Donovan
Version: 1.0
Author URI: http://lewisdonovan.co.uk
* @link https://github.com/lewisdonovan/acf-fields-to-wp-rest-api/
* @since 1.0
* @package acf2api
*
* @wordpress-plugin
* Plugin Name: ACF Fields to WP REST API
* Plugin URI: https://github.com/lewisdonovan/acf-fields-to-wp-rest-api
* Description: Programmatically add data from Advanced Custom Fields to the Wordpress REST API
* Author: Lewis Donovan
* Version: 1.1
* Author URI: http://lewisdonovan.co.uk
*/

include 'post-types.php';
Expand Down
4 changes: 2 additions & 2 deletions post-types.php
@@ -1,8 +1,8 @@
<?php

//LOOP THROUGH POST TYPES AND ADD ACF FIELDS TO API
add_action( 'rest_api_init', 'sme_hook_all_post_types', 99 );
function sme_hook_all_post_types(){
add_action( 'rest_api_init', 'acf2api_hook_all_post_types', 99 );
function acf2api_hook_all_post_types(){

//Get all the post types
global $wp_post_types;
Expand Down
4 changes: 2 additions & 2 deletions taxonomies.php
@@ -1,8 +1,8 @@
<?php

//LOOP THROUGH TAXONOMIES AND ADD ACF FIELDS TO API
add_action( 'rest_api_init', 'sme_hook_all_terms', 99 );
function sme_hook_all_terms(){
add_action( 'rest_api_init', 'acf2api_hook_all_terms', 99 );
function acf2api_hook_all_terms(){
$taxonomies = array_keys( get_taxonomies() );

foreach ($taxonomies as $taxonomy) {
Expand Down

0 comments on commit 701cc7f

Please sign in to comment.