Skip to content

Commit

Permalink
WIP #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Postigo committed Sep 22, 2017
1 parent 33f533b commit 0f5cb1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
include __DIR__ . '/classes/class-wpseo-replace-vars.php';
include __DIR__ . '/classes/class-frontend.php';

add_action( 'plugins_loaded', array( 'WPAPIYoastMeta', 'init' ));

/**
* Plugin Name: WP REST API Yoast SEO
* Description: Adds Yoast fields to page and post metadata to WP REST API responses
Expand Down Expand Up @@ -32,6 +34,11 @@ class WPAPIYoastMeta {
'yoast_wpseo_twitter-image'
);

public static function init() {
$class = __CLASS__;
new $class;
}

function __construct() {
add_action( 'rest_api_init', array( $this, 'add_yoast_data' ) );

Expand Down Expand Up @@ -201,4 +208,4 @@ function get_site_info($site_info) {

}

$WPAPIYoastMeta = new WPAPIYoastMeta();
//$WPAPIYoastMeta = new WPAPIYoastMeta();

0 comments on commit 0f5cb1a

Please sign in to comment.