Files
wp-graphql-woocommerce/includes/connection/class-posts.php
T

35 lines
678 B
PHP
Raw Normal View History

2019-03-31 23:16:11 -04:00
<?php
/**
* Connection type - Posts
*
* Registers connections to Posts
*
2019-10-25 19:13:36 -04:00
* @package WPGraphQL\WooCommerce\Connection
2019-03-31 23:16:11 -04:00
*/
2019-10-25 19:13:36 -04:00
namespace WPGraphQL\WooCommerce\Connection;
2019-03-31 23:16:11 -04:00
use WPGraphQL\Connection\PostObjects;
/**
* Class - Posts
*/
class Posts extends PostObjects {
2020-02-27 21:30:21 -03:00
2019-03-31 23:16:11 -04:00
/**
2020-02-27 21:30:21 -03:00
* Registers the various connections from other WooCommerce Types to other WordPress post-types.
2019-03-31 23:16:11 -04:00
*/
public static function register_connections() {
2019-10-24 22:11:04 -04:00
register_graphql_connection(
self::get_connection_config(
get_post_type_object( 'attachment' ),
array(
'fromType' => 'Product',
'toType' => 'MediaItem',
'fromFieldName' => 'galleryImages',
)
)
);
2019-03-31 23:16:11 -04:00
}
}