feat: Media Focus Point plugin integration
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
"wpackagist-plugin/acf-extended": "*",
|
"wpackagist-plugin/acf-extended": "*",
|
||||||
"wpackagist-plugin/clean-image-filenames": "*",
|
"wpackagist-plugin/clean-image-filenames": "*",
|
||||||
"wpackagist-plugin/disable-comments": "*",
|
"wpackagist-plugin/disable-comments": "*",
|
||||||
|
"wpackagist-plugin/media-focus-point": "*",
|
||||||
"wpackagist-plugin/seo-by-rank-math": "*",
|
"wpackagist-plugin/seo-by-rank-math": "*",
|
||||||
"wpackagist-plugin/wp-graphql": "*",
|
"wpackagist-plugin/wp-graphql": "*",
|
||||||
"wpackagist-plugin/wpgraphql-acf": "*"
|
"wpackagist-plugin/wpgraphql-acf": "*"
|
||||||
|
|||||||
20
composer.lock
generated
20
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "9673ea7f3e3f21866ae50f70e1d6a16b",
|
"content-hash": "f563233465b6f95dac3c6b33962f6aed",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "axepress/wp-graphql-plugin-boilerplate",
|
"name": "axepress/wp-graphql-plugin-boilerplate",
|
||||||
@@ -418,6 +418,24 @@
|
|||||||
"type": "wordpress-plugin",
|
"type": "wordpress-plugin",
|
||||||
"homepage": "https://wordpress.org/plugins/disable-comments/"
|
"homepage": "https://wordpress.org/plugins/disable-comments/"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "wpackagist-plugin/media-focus-point",
|
||||||
|
"version": "2.0.4",
|
||||||
|
"source": {
|
||||||
|
"type": "svn",
|
||||||
|
"url": "https://plugins.svn.wordpress.org/media-focus-point/",
|
||||||
|
"reference": "tags/2.0.4"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://downloads.wordpress.org/plugin/media-focus-point.2.0.4.zip"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"composer/installers": "^1.0 || ^2.0"
|
||||||
|
},
|
||||||
|
"type": "wordpress-plugin",
|
||||||
|
"homepage": "https://wordpress.org/plugins/media-focus-point/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "wpackagist-plugin/seo-by-rank-math",
|
"name": "wpackagist-plugin/seo-by-rank-math",
|
||||||
"version": "1.0.263",
|
"version": "1.0.263",
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ require_once __DIR__ . '/includes/vendors/tinymce.php';
|
|||||||
require_once __DIR__ . '/includes/vendors/wpgraphql.php';
|
require_once __DIR__ . '/includes/vendors/wpgraphql.php';
|
||||||
|
|
||||||
// WPGraphQL
|
// WPGraphQL
|
||||||
|
require_once __DIR__ . '/includes/wpgraphql/media-focus-point.php';
|
||||||
require_once __DIR__ . '/includes/wpgraphql/term-connection.php';
|
require_once __DIR__ . '/includes/wpgraphql/term-connection.php';
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Expose 'bg_pos_desktop' post meta on MediaItem type in WPGraphQL
|
||||||
|
add_action( 'graphql_register_types', 'leblanc_graphql_register_media_focus_point' );
|
||||||
|
function leblanc_graphql_register_media_focus_point() {
|
||||||
|
register_graphql_field(
|
||||||
|
'MediaItem',
|
||||||
|
'objectPosition',
|
||||||
|
array(
|
||||||
|
'type' => 'String',
|
||||||
|
'description' => 'CSS object-position value from Media Focus Point plugin',
|
||||||
|
'resolve' => static function ( $media_item ) {
|
||||||
|
return get_post_meta( $media_item->databaseId, 'bg_pos_desktop', true );
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user