Action hook 'xmlrpc_call_success_mw_newMediaObject'

in WP Core File wp-includes/class-wp-xmlrpc-server.php at line 6533

View Source

xmlrpc_call_success_mw_newMediaObject

Action Hook
Description
Fires after a new attachment has been added via the XML-RPC MovableType API.

Hook Information

File Location wp-includes/class-wp-xmlrpc-server.php View on GitHub
Hook Type Action
Line Number 6533

Hook Parameters

Type Name Description
int $attachment_id ID of the new attachment.
array $args An array of arguments to add the attachment.

Usage Examples

Basic Usage
<?php
// Hook into xmlrpc_call_success_mw_newMediaObject
add_action('xmlrpc_call_success_mw_newMediaObject', 'my_custom_function', 10, 2);

function my_custom_function($attachment_id, $args) {
    // Your custom code here
}

Source Code Context

wp-includes/class-wp-xmlrpc-server.php:6533 - How this hook is used in WordPress core
<?php
6528  		 * @since 3.4.0
6529  		 *
6530  		 * @param int   $attachment_id ID of the new attachment.
6531  		 * @param array $args          An array of arguments to add the attachment.
6532  		 */
6533  		do_action( 'xmlrpc_call_success_mw_newMediaObject', $attachment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
6534  
6535  		$struct = $this->_prepare_media_item( get_post( $attachment_id ) );
6536  
6537  		// Deprecated values.
6538  		$struct['id']   = $struct['attachment_id'];

PHP Documentation

<?php
/**
		 * Fires after a new attachment has been added via the XML-RPC MovableType API.
		 *
		 * @since 3.4.0
		 *
		 * @param int   $attachment_id ID of the new attachment.
		 * @param array $args          An array of arguments to add the attachment.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/class-wp-xmlrpc-server.php
Related Hooks

Related hooks will be displayed here in future updates.