wppaste
WordPress

apply_filters( 'xmlrpc_allow_post_type_writes', bool $allowed, WP_Post_Type $post_type )

Since
7.1.1
Filters whether a post type accepts writes via XML-RPC.

Description

Defaults to false for internal-only builtin post types (public=false, show_in_rest=false, _builtin=true), such as customize_changeset, whose writes are meant to flow through dedicated helpers. Return true to opt a post type back in.

Compatibility

WordPress
since 7.1.1
  • 6.7.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

Parameters

$allowedbool
Whether the post type accepts XML-RPC writes.
$post_typeWP_Post_Type
The post type object.

Where this hook fires · 1

  • wp-includes/class-wp-xmlrpc-server.php:1486wp_xmlrpc_server::_insert_post()

Source code

		 *		 * @since 7.1.1		 *		 * @param bool         $allowed   Whether the post type accepts XML-RPC writes.		 * @param WP_Post_Type $post_type The post type object.		 */		$allowed = apply_filters( 'xmlrpc_allow_post_type_writes', ! $is_internal_only, $post_type ); 		if ( ! $allowed ) {			return new IXR_Error( 403, __( 'Sorry, this post type is not supported over XML-RPC.' ) );		} 		$update = ! empty( $post_data['ID'] );

Changelog

Introduced in 7.1.1. Unchanged from 6.7.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.3 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.