Overview
  • Namespace
  • Class

Namespaces

  • WPGraphQL
    • Data
    • Type
      • Avatar
      • Comment
        • Connection
      • CommentAuthor
      • EditLock
      • Enum
      • MediaItem
        • Mutation
      • Plugin
        • Connection
      • PostObject
        • Connection
        • Mutation
      • PostType
      • Setting
      • Taxonomy
      • TermObject
        • Connection
        • Mutation
      • Theme
        • Connection
      • Union
      • User
        • Connection
        • Mutation
    • Utils

Classes

  • PostObjectCreate
  • PostObjectDelete
  • PostObjectMutation
  • PostObjectUpdate
  • TermObjectDelete

Class PostObjectMutation

Class PostObjectMutation

Namespace: WPGraphQL\Type\PostObject\Mutation
Package: WPGraphQL\Type\PostObject
Located at Type/PostObject/Mutation/PostObjectMutation.php

Methods summary

public static mixed|array|null
# input_fields( $post_type_object )

Parameters

$post_type_object

Returns

mixed|array|null
$input_fields
public static array
# prepare_post_object( array $input, WP_Post_Type $post_type_object, string $mutation_name )

This handles inserting the post object

This handles inserting the post object

Parameters

$input
The input for the mutation
$post_type_object
The post_type_object for the type of post being mutated
$mutation_name
The name of the mutation being performed

Returns

array
$insert_post_args

Throws

Exception
public static
# update_additional_post_object_data( $new_post_id, $input, $post_type_object, $mutation_name )

This updates additional data related to a post object, such as postmeta, term relationships, etc.

This updates additional data related to a post object, such as postmeta, term relationships, etc.

Parameters

$new_post_id
$input
$post_type_object
$mutation_name
public static array|false
# set_edit_lock( integer $post_id )

This is a copy of the wp_set_post_lock function that exists in WordPress core, but is not accessible because that part of WordPress is never loaded for WPGraphQL executions

This is a copy of the wp_set_post_lock function that exists in WordPress core, but is not accessible because that part of WordPress is never loaded for WPGraphQL executions

Mark the post as currently being edited by the current user

Parameters

$post_id
ID of the post being edited.

Returns

array|false

Array of the lock time and user ID. False if the post does not exist, or there is no current user.

API documentation generated by ApiGen