I found one solutions and it works, just in case someone could have the same question, I know that the response could be with an:
if(input==""){
}
But the problem was that I’m inserting every model in an object, so if the fields are empty, it insert in the object empty values, so I just did this:
if ($single_model['car_model'] != "") {
array_push($models_to_insert, $single_model);
} else {}
because if no model name is added in the first input and user clicks “update” or “publish” button, means that user don’t want/need another model
Not sure if it’s the best way but it works
Related Posts:
- When unit testing a plugin, does the plugin need to be in the wp-content/plugins directory of the WordPress tests install?
- How can I prevent a plugin from updating unless it’s minimum PHP version is met?
- Simple form that saves to database
- Get Current user email as a return string value
- How can I make content disappear when a user logs in?
- Determining where fopen() is writing files when used from WordPress AJAX call [closed]
- How Restrict access to admin dashboard by specific static ip?
- New Plugin: Post update pushes a copy as a revision
- Overide a function that is inside a plugin
- How to get images from EDD post?
- Add multiple attributes to product from php
- How to install and activate a plugin via an external PHP script
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- How to remove xmlns on language_attributes()?
- How to initialize something in unit test before the init hook being called?
- Add category to body class
- Plugin Development sqlite or WordPress’ database
- How to review WordPress website php version compatibility?
- Add keywords meta to index.php page
- Download any file after submitting a form [closed]
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- woocommerce 3.2.1 not sending order notification emails
- Redirecting a buddyboss profile tab to a different tab if not subscribed to a specific membership
- Add a CSS class based on categroy id to archive pages
- Access WordPress data from external PHP application.
- Problem with PHP wordpress, Undefined index: in C:\xampp\htdocs\wordpress\wp-content\plugins\epoch\classes\core.php on line 190 [closed]
- What are the specifics of WordPress development I need to know? [closed]
- How to create a custom post type that contains another custom post type?
- WP Query. Is there a maximum size?
- WP Plugins – Use includes to display page content
- Finding the screen id of a page generated with add_menu_page
- Can i add custom code in Source, Header from function.php?
- How to make multiple admin pages for one plugin?
- Problem with isset and $_POST
- Redeclare function after plugin activation
- get_edit_post_link() not working on wp-cron
- Woocommerce Backend Search by Title and SKU
- Control page content visibility based on URL parameter
- WooCommerce Shopping Cart Not Initially Showing Products [closed]
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- How to translate wordpress error message
- Override a Plugin Function
- How to add/change (woocommerce) product tab icon
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- I want to generate the pdf and save it in library?
- Add key and value to an array in another file
- Trying to make a simple wordpress plugin, having difficulties understanding how to make it?
- wordpress plugin license issue -New plugin development
- Create “new pages” within the admin section of plugin
- How can I show registration form inside modal?
- More gentle way to hook WordPress custom url
- add_action for publish_post doesn’t work
- How to proper escape echo inside a javascript tag
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- How to properly replace the_content with the html in a php file?
- How to Add text value in Automatically in this conditions?
- Custom Logo Link WordPress
- How to convert Currency from USD to other IP Based currency in Php function
- How do I reinit WordPress plugins dynamically using jS?
- admin_notices show after load completed
- WordPress + python integration
- Newbie problem with adding include wp_footer
- Hide content for specific users with id
- adding dynamic/multiple slug values in ‘option_none_value’
- What is the right way to populate a dropdown from MySql?
- make p tag collapsed after 3 rows
- Using id to show item
- I can’t view the orders on the woocomerce dashboard with the brainblocks plugin
- WP Migrate DB Pro plugin cannot transfer Media files to remote server
- Generate and send ICS file through WordPress
- WP Plugin permissions – create new files
- Run a Change Role Cron Job on WordPress via cPanel
- How to display variables from plugin?
- How to make the first letter of a post title uppercase, in a plugin?
- How to echo meta_key in easy digital downloads receipt (Purchase Confirmation page)
- Plugin error “array_key_exists(): The first argument should be either a string or an integer” [closed]
- Creating Admin Submenu Page via Class Method
- .htaccess file doesn’t work, with hundred tries
- How to change the product short description for each product with PHP?
- I want add repository theme folder
- Migrating custom php we wrote from functions.php into a site-specific plugin
- What is the correct entry point for capturing coverage data
- ACF Repeater Field Question [closed]
- plugins_loaded action is not working properly
- Creating a user ‘add custom field’ section
- How do I convince this button to do something when it is clicked?
- WordPress function to add text
- How to Set Limit with WordPress Get Bookmarks Shortcode
- TheCartPress plugin – Make every item in store unique
- Doing action based on input from options menu
- Insert dynamic content into posts
- avatar displays outside of targeted area
- WordPress User Frontend Editing Custom Fields
- My wordpress site wont load, it gives header error warnings
- Can anyone see a syntax error in this? [closed]
- how to show selected options drop down menu values in attributes field in after saving post.php
- Can’t use updated variables in handle function
- Is there any WordPress Plugin that provides video editing from front end side? [closed]
- Accessing Correct Database to Create REST API Endpoint
- How do I replace a logo image that’s hard-coded into a plugin’s logo.php file?