Actually, that hook just lets you tie in to the beginning of executing that function, it doesn’t let you override anything.
If you want to replace this function entirely, I recommend two different options:
1. Don’t use it
Just define your own XMLRPC method (myNamespace.newMediaObject
) and call that instead.
2. Replace it
You can tie in to the xmlrpc_methods
filter the same way you would to add a new method and can replace the callback for metaWeblog.newMediaObject
:
add_filter( 'xmlrpc_methods', 'myMediaHandler' );
function myMediaHandler( $methods ) {
$methods[ 'metaWeblog.newMediaObject' ] = 'myMediaObject';
return $methods;
}
function myMediaObject( $args ) {
// ... custom functionality
}
Just be sure to maintain the same format with the $args array and to call/apply the same actions/filters in your custom method so that you don’t run into any surprises.
Related Posts:
- custom XMLRPC method plus authentication of user & WooCommerce order
- Best way for plugin to accept POSTs?
- PHP library that can merge stylesheet with inline style [closed]
- Turn off Admin Bar (Toolbar) in backend – no easy way
- API WordPress is Limited? Return False
- Update Option Stored in Multi-Dimensional Array
- check if Gutenberg is currently in use
- WordPress Plugin Development – Headers Already Sent Message
- Get page content using slug
- Best practices for using the transients API
- $wpdb->insert_id
- Remove profile picture option (and other things) from profile.php (in admin)
- How to disable plugin update notification for a specific plugin in Multisite
- How Can I Add a Filter to Class Instance Only?
- Getting old term value with edited_{$taxonomy} | Hook
- Headers already sent error with CSV export plugin
- How to add HTML / Form to an Admin Bar Menu
- Call activation hook multiple times
- Adding custom code into header.php using a plugin
- Building a better media uploader for WordPress
- Two-step login process – Is it possible?
- Calling clean_term_cache() fails when called in the same plugin that creates terms, succeeds when called separately?
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- Woocommerce how to update variable product price programitically?
- Singular name Plugin localization
- Using $wpdb object in a widget
- Unified Approach for Placing Option Pages
- Define a function outside a class and call the function using action or filter hook
- Modifying WordPress plugins
- On plugin deactivation hide its shortcode
- Can I submit a plugin that follows the PSR-2 coding style guide?
- How to get current page id through the plugin
- Create a new page in a plugin
- Header Button Chance Polylang Elementor
- Find source of notice / warning / errors efficiently
- Will cron job run if page loaded is being served from cache?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Use wp_set_post_terms() instead of wp_insert_post()
- Adding set of custom fields to WordPress Post in Dashboard
- TinyMCE 4.7.11 custom styles using styleselect – what does the ‘attributes’ argument do?
- Modifying meta tags after doing ajax call in plugin
- Create a free scripts and styles template within a plugin
- Is there a way to list all actions registered by a plugin or theme?
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- How can I turn a custom wordpress page into a product page?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- How to enqueue style in WordPress plugin from theme files?
- Bootstrap version conflict 3 with 4 for wordpress theme and plugin [closed]
- pre_get_post alter current post id
- 3rd Party Plugin dependency – how to correctly load classes
- Auto-Populate Image After Media Upload
- Problems with cron
- WP Multisite login not working on one subsite. Possibly cookies/ history issue?
- dbDelta not installing database
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- Can’t get CSS Into the Head via add_action
- Remove Default Blogroll Links via Plugin script
- Catching Form Submission in WordPress Admin Panel
- Filter posts in pre_get_posts order by meta value date (desc or asc)
- How to display the category id along with category name on categories list?
- Save temporary registration data
- Activate / Deactivate plugin
- How to validate inputs with filter in register_setting callback
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- A question on init and activation hooks
- Always hide a page from the menu
- Add custom html classes to gutenberg wrapper
- Author Meta in Author URL Link
- Update database record in plugin
- Different style for specific rows in custom list table using WP_List_Table
- get_comment_meta() for a filter hook in a plugin
- form does not generate $_POST request
- Callback function quicktags that uses variable in start tag
- Font Awesome stopped showing icons, shows &# text instead [closed]
- WordPress Plugin Tool Tip Helpers
- How can I add the Post ID to Class Name in Jquery?
- How to show metabox just in post.php in admin?
- Can I use a hook other than ‘init’ to handle form submissions?
- Managing Custom Designed Content
- Stop theme displaying comments
- Do a summary based on sections in a post
- Plugin as custom page
- Can’t switch theme after activation
- Plugin capabilities
- plugin will not offer update even though a new version is available
- How do I replace title with my plugin?
- Deactivate plugin on registration
- How to filter manage categories listing
- Enqueue Script in custom plugin before other
- How to remove a class [closed]
- Checking if the query is empty does not work
- Remove default wordpress roles
- What is the meta_query key name for the woo product average rating? [closed]
- how to catch a data from a array in WordPress
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- External api call using wordpress
- Set link dialog to open in blank by default
- plugabble wp_authenticate function not works from wp-login.php