From a56632e82183824affd4801ee9818c5587fcb586 Mon Sep 17 00:00:00 2001 From: Conrad Fuhrman Date: Thu, 4 Feb 2021 13:24:14 -0600 Subject: [PATCH] Update for Works Post Type --- composer.json | 2 +- seo-to-api.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 891e8b6..3ac7bcb 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "GPL-3.0", "require": { "php": ">=7.0", - "composer/installers": "~1.0" + "composer/installers": "v1.8.0" }, "extra": { "installer-name": "seo-to-api" diff --git a/seo-to-api.php b/seo-to-api.php index d9b0a41..241ca37 100644 --- a/seo-to-api.php +++ b/seo-to-api.php @@ -3,7 +3,7 @@ * Plugin Name: SEO to API * Plugin URI: https://github.com/conradfuhrman/SEO-To-API * Description: Expose the meta of the SEO Framework to the WP API - * Version: 1.1 + * Version: 1.3 * Author: Conrad Fuhrman * Author URI: https://github.com/conradfuhrman/ * @@ -22,7 +22,7 @@ if (isset($_REQUEST['slug'])) { $args = [ 'name' => $_REQUEST['slug'], - 'post_type' => ['post', 'page', 'work'], + 'post_type' => ['post', 'page', 'works'], 'post_status' => 'publish', 'numberposts' => 1 ]; @@ -31,31 +31,31 @@ - register_rest_field(['post', 'page', 'work'], 'meta_title', [ + register_rest_field(['post', 'page', 'works'], 'meta_title', [ 'get_callback' => function () use ($post) { return html_entity_decode(the_seo_framework()->get_title($post->ID)); } ]); - register_rest_field(['post', 'page', 'work'], 'meta_description', [ + register_rest_field(['post', 'page', 'works'], 'meta_description', [ 'get_callback' => function () use ($post) { return html_entity_decode(the_seo_framework()->get_description($post->ID)); } ]); - register_rest_field(['post', 'page', 'work'], 'meta_social_image_url', [ + register_rest_field(['post', 'page', 'works'], 'meta_social_image_url', [ 'get_callback' => function () use ($post) { return html_entity_decode(the_seo_framework()->get_social_image( ['post_id' => $post->ID,])); } ]); - register_rest_field(['post', 'page', 'work'], 'meta_open_graph_title', [ + register_rest_field(['post', 'page', 'works'], 'meta_open_graph_title', [ 'get_callback' => function () use ($post) { return html_entity_decode(the_seo_framework()->get_open_graph_title($post->ID)); } ]); - register_rest_field(['post', 'page', 'work'], 'meta_open_graph_description', [ + register_rest_field(['post', 'page', 'works'], 'meta_open_graph_description', [ 'get_callback' => function () use ($post) { return html_entity_decode(the_seo_framework()->get_open_graph_description($post->ID)); } ]); - register_rest_field(['post', 'page', 'work'], 'meta_twitter_title', [ + register_rest_field(['post', 'page', 'works'], 'meta_twitter_title', [ 'get_callback' => function () use ($post) { return html_entity_decode(the_seo_framework()->get_twitter_title($post->ID)); } ]); - register_rest_field(['post', 'page', 'work'], 'meta_twitter_description', [ + register_rest_field(['post', 'page', 'works'], 'meta_twitter_description', [ 'get_callback' => function () use ($post) { return html_entity_decode(the_seo_framework()->get_twitter_description($post->ID)); } ]); }