Found answer to my question.
I didn’t want to specify each data parameter in the function definition as it could get long. Therefore, I am retrieving them using $_POST
global variable.
I know thats not a good solution, if you know any better let me know.
public function create_document($_files = null){
if(!empty($_files)) {
// process file
}
$data = $_POST;
// process $data is you want
// $data['doc_id']
// $data['case_reference']
.....
.....
}
Related Posts:
- How to create WordPress custom end point with multiple parameters?
- WordPress wp-json API – Custom Post Type returns 403
- WP REST API Access-Control-Allow-Origin response is cached
- Update plugin from personal API
- Does a plugin’s “main” file need to be named the same as the folder containing it?
- Symlinked plugin directory doesn’t appear in Admin
- Where the Nickname is being used in WordPress
- enqueue script only if it is not already enqueue
- How can I limit functionality in one version of a plugin?
- How can I include a setting that has a variable number of values in a settings page using register_setting?
- Adding dynamic section to WordPress
- Plugin child folder?
- Custom data-id wp_enqueue_script
- Yoast SEO blocking/re-initialising longer running process
- Add Fields with Sub-Fields to WP Job Manager
- template_redirect not being called when using ajax
- How use %like% in sql statement wordpress
- Can I use a form in a dashboard widget?
- Is there a way to alter the order in which the plugins appear in the page?
- How to correctly detect accessing wp-content/uploads?
- Retrieving plugin options value saved through setting
- How to ‘clone’ a wp plugin to make small changes
- MITM risk of not sanitizing?
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Change plugin main file name (that is currently in the repo)
- Edit Yoast SEO breadcrumbs output [closed]
- Enqueue WordPress plugin scripts below all other JS
- Using a post-signup hook to get user details
- White page by using filter template_include
- Is there any kind of theme on WordPress to sell my own movies?
- User switching only with specific role and return
- Fromcraft Plugin On click submit button [closed]
- Suggestions on Approach to New Plugin I’m Stuck On
- How to redirect users to their profile after they successfully edit their profile
- Insert Array in Plugin Database
- WordPress error: Options page Setting_ not found in the allowed options list
- What is wordpress way to access a plugin’s classes/models to load custom post type data?
- flush_rewrite_rules() not working with update_option_{$option}
- plugin wraps the entire content
- Shortcode Attributes to Return different $_POST
- How to ignore extra whitespaces in translation functions like _e?
- How does translation (gettext) work for translating config file of plugin?
- How programatically cause uploads folder to be created?
- Next Previous Post in wordpress with previous / next link with title?
- How to use existing hook in twentytwelve to all theme of wordpress?
- How to get a notification when the plugin is installed?
- Apply html elements in php statement
- WordPress Post HTML after Posting
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Settings options not showing up on Sub Menu page in WordPress plugin
- unregister a sidebar widget
- How to Get Category Name When Export Products
- Remove List Bullets
- Custom Meta box change size
- Could add_query_arg() redirect user to external site?
- How to set plugin auto-update Enabled by default?
- Custom plugin activation error
- The Build menu theme is frozen with the wordpress theme
- How to capture hidden values with Gravity Forms
- How to translate to spanish wordpress hardcoded content/files?
- what functions to use to resize images and create DB metadata for them after/during upload?
- Multiple image selection custom widget
- How to Create a Learning Management Plugin in WordPress to Manage Courses [LMS]
- How to prevent redoing get_posts queries and make results available to other scripts?
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Change Woo Custom Endpoint Titles from a Plugin
- Paid Membership Pro displaying a user name in PHP
- Make another copy of a plugin and install it
- Store admin page into variable
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- WP Plugin CSS not being applied to page
- Overwriting Plugin’s Ajax callback function from theme
- How can I get the Post ID and Post Type within a Must Use Plugin?
- Creating Nested custom fields
- Unable to sync woocommerce variations
- Can’t find variable is_single in my jQuery plugin
- WordPress Cron function is not working
- WP internationalization not loaded
- Plugin hook breaks new WP 4.0 media library grid view?
- How to get site homepage from plugin?
- Adding custom cron_schedule prior to wp_schedule_event
- Create plugin with form in post and submit it to specific form
- Storing values in Post Meta vs new tables
- Get page type to display content
- Widget redirecting to home page
- Capturing POST data
- Is an Office a custom post type [closed]
- How to add image for custom taxonomy
- I am using multi image metabox plugin but I did get how to display the images in templete?
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- wordpress Ajax success doesn’t return the value
- How to open author url linked to a new tab in settings page in the WordPress plugin list
- How can I properly sanitize the update_option in WordPress?
- Why is my menu page not being displayed?
- How can I make my plugin detect if a certain theme is active?
- Is it possible to create post in wordpress using postman?
- wp_enqueue_script doesn’t load JS in plugin
- AI Code For OpenAI
- Pulsing circle before the post title (Breaking news flash)