BLUE
PHP 7.4.33
Path:
/var/www/candid-stg.bitkit.dk/httpdocs/wp-content/plugins/wp-graphql/deprecated
Run
Logout
Edit File
Size: 2.64 KB
Close
/var/www/candid-stg.bitkit.dk/httpdocs/wp-content/plugins/wp-graphql/deprecated/MenuItemObjectUnion.php
Text
Base64
<?php namespace WPGraphQL\Type\Union; use WPGraphQL\Model\Post; use WPGraphQL\Model\Term; use WPGraphQL\Registry\TypeRegistry; /** * Class MenuItemObjectUnion * * @todo Remove in 3.0.0 * @deprecated 0.10.3 * @codeCoverageIgnore */ class MenuItemObjectUnion { /** * Registers the Type * * @param ?\WPGraphQL\Registry\TypeRegistry $type_registry * * @return void * @throws \Exception */ public static function register_type( ?TypeRegistry $type_registry = null ) { register_graphql_union_type( 'MenuItemObjectUnion', [ 'typeNames' => self::get_possible_types(), 'description' => static function () { return __( 'Deprecated in favor of MenuItemLinkable Interface', 'wp-graphql' ); }, 'resolveType' => static function ( $obj ) { _doing_it_wrong( self::class, esc_attr__( 'The MenuItemObjectUnion GraphQL type is deprecated in favor of MenuItemLinkable Interface and will be removed in a future version of WPGraphQL', 'wp-graphql' ), '0.10.3' ); $type_registry = \WPGraphQL::get_type_registry(); // Post object if ( $obj instanceof Post && isset( $obj->post_type ) && ! empty( $obj->post_type ) ) { /** @var \WP_Post_Type $post_type_object */ $post_type_object = get_post_type_object( $obj->post_type ); return $type_registry->get_type( $post_type_object->graphql_single_name ); } // Taxonomy term if ( $obj instanceof Term && ! empty( $obj->taxonomyName ) ) { /** @var \WP_Taxonomy $tax_object */ $tax_object = get_taxonomy( $obj->taxonomyName ); return $type_registry->get_type( $tax_object->graphql_single_name ); } return $obj; }, ] ); } /** * Returns a list of possible types for the union * * @return string[] */ public static function get_possible_types() { /** * The possible types for MenuItems should be just the TermObjects and PostTypeObjects that are * registered to "show_in_graphql" and "show_in_nav_menus" */ $args = [ 'show_in_nav_menus' => true, 'graphql_kind' => 'object', ]; $possible_types = []; /** * Add post types that are allowed in WPGraphQL. */ foreach ( \WPGraphQL::get_allowed_post_types( 'objects', $args ) as $post_type_object ) { if ( isset( $post_type_object->graphql_single_name ) ) { $possible_types[] = $post_type_object->graphql_single_name; } } // Add taxonomies that are allowed in WPGraphQL. foreach ( \WPGraphQL::get_allowed_taxonomies( 'objects', $args ) as $tax_object ) { if ( isset( $tax_object->graphql_single_name ) ) { $possible_types[] = $tax_object->graphql_single_name; } } return $possible_types; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Comments.php
1.59 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MenuItemObjectUnion.php
2.64 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MenuItems.php
1.31 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostObject.php
1.71 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostObjects.php
1.71 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostObjectUnion.php
1.81 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Taxonomies.php
812 B
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TermObject.php
853 B
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TermObjects.php
1.65 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TermObjectUnion.php
1.83 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Types.php
1.52 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Users.php
1.27 KB
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
wp-cli.php
721 B
lrw-r--r--
2026-02-02 10:01:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).