xmlrpc_allow_post_type_writes
Filters whether a post type accepts writes via XML-RPC.
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.
Usage
add_filter( 'xmlrpc_allow_post_type_writes', 'wp_kama_xmlrpc_allow_post_type_writes_filter', 10, 2 );
/**
* Function for `xmlrpc_allow_post_type_writes` filter-hook.
*
* @param bool $allowed Whether the post type accepts XML-RPC writes.
* @param WP_Post_Type $post_type The post type object.
*
* @return bool
*/
function wp_kama_xmlrpc_allow_post_type_writes_filter( $allowed, $post_type ){
// filter...
return $allowed;
}
- $allowed(true|false)
- Whether the post type accepts XML-RPC writes.
- $post_type(WP_Post_Type)
- The post type object.
Changelog
| Since 7.1.1 | Introduced. |
Where the hook is called
xmlrpc_allow_post_type_writes
wp-includes/class-wp-xmlrpc-server.php 1486
$allowed = apply_filters( 'xmlrpc_allow_post_type_writes', ! $is_internal_only, $post_type );