Sounds like it’s expecting tag IDs as integers and you’re sending strings. split
returns an array of strings, even if those strings are numbers. Instead of using .split
try something like this
let tags = JSON.parse("[" + this.newPostTags + "]");
If you really like split then you would do this:
let tags = this.newPostTags.split(",").map(Number);
Related Posts:
- New WP_Customize API – how does it work under the hood?
- In the new Theme Customizer API, how to send a value from the front back to the admin panel?
- Display tags with a twist
- How do I perform a “get” call to an external API, and then display the JSON results on a page in my WordPress site?
- How to remove tag cloud from taxonomy admin edit page?
- Show posts on a page based on a category and tag(s)
- Add Custom API Call to WP-Login.php
- Set Title from Custom Template
- Customizer JS API get value of customizer field
- Custom Tags Archive – permalinks not working
- Make tag archive display post are ordered by post format
- title tag function
- custom email validation using javascript api with elementor pro and code snippets
- Get /users/me details from WordPress backend
- mailchimp integration on a custom footer
- Custom display for homepage, tag and author pages
- Creating a search with tag variable also added for more detailed results
- Show WP content on different PHP Sites
- Assign classes to Custom fields
- Is there a flowchart for WordPress loading sequence?
- How do register_sidebar() and get_sidebar() work together?
- Is it possible to change the attributes of a registered style or script before it fires?
- how to change “published date” format on edit.php (Posts page)?
- How to change submit button value in comment from “Post Comment” to “Send”
- Getting rid of the #038; when string replacing content
- Querying multiple WordPress custom fields with AND qualifier
- WordPress custom post types breaks permalink on theme reinstall
- Creating a searchable A-Z listing of hundreds of companies/services
- Show attribute description when filtering by that attribute
- Create a Custom menu item fetched by Product Categories and Sub Categories
- Multi-Site Plugin Activated (Not Network-Activated), What Happens?
- Add custom column to Users admin panel with Types user custom fields?
- How do I change the default admin color scheme in MP6
- woocommerce Add custom field set like billing fields
- Adding action to save_post, post needs to be saved twice for function to work
- Calling a php file from a javascript file in wordpress
- 1 bit audio player
- Outputting posts from post id´s in variable
- Auto redirect after session expire, but only for one user
- Add ‘Creator’ User Meta when adding user
- Auto login after wordpress installation
- Determining What Content Gets Displayed
- Truncating varying lengths of information
- How to get pages id in array in get_pages?
- Access post meta in future_to_publish function
- Javascript Solution Remove Specific Tag but leave the rest in a specific DIV
- How to create a completely private wordpress with multiple membership levels
- Why do posts disappear from admin after upgrading from WP 2.7.1 to 3.0.1?
- woocommerce_checkout_fields modifying existing billing_phone label created new field
- How to change the category url jusy show /category/%category_id% in wordpress?
- custom meta box for page default template
- Child Theme with multiple css files
- How to host 2 subdomains as lookalike destinations under one master domain?
- “An automated WordPress update has failed to complete – please attempt the update again now”– But there is no .maintenance file
- How do I redirect a post url to a custom url?
- Custom Login Process
- How could I verify whole WP directory before/after working with a freelancer? [closed]
- How to customize
- Modify files without losing customization after updates
- Determine if action was executed in functions
- Extending core class in plugin
- Is it possible to make wordpress LMS
- Saving contact form 7 data into custom Table
- How can I tag a menu item as visited for each unique user?
- Custom Content Page
- Add Member’s birthdate from Backend and shows it on frontside [closed]
- How to add functionality to an existing theme (using child themes)
- Featured Images for Tags?
- How to Render Post Types in RSS Feed?
- URL and Site title outputting on Login page
- 404 when Previewing an unsaved draft
- Display a specified content on a Page and all its child pages
- Custom field not editable by the user
- WordPress category custom title
- How do I make mysite.com/comingsoon WordPress to become my main website’s WordPress?
- Use a custom page with dynamic content as a user profile page
- Customize section does not show my widget areas
- Invitation link to a site in multisite network does not work?
- Add helper text in custom-header section in admin
- How to edit content in code view of home page when there is some theme applied?
- How to display strikethrough text in button text (for special offer)
- Lightbox not showing image caption
- WordPress core jquery version file not loaded?
- Can we add an extra button on woocommerce shop page and use it to send the product info including image in a mail?
- WP_User_Query Search Multiple Keywords from a Multi-Select Field?
- Add a custom intro page
- clickable toggle menu, help
- How to change custom link of subpages from of localhost to website
- How to append the excerpt to the content in the single post page?
- How to Password Protect whole site except for some subdirectories
- Custom dropdown search form that allows users to select option B based from Option 1
- Ordering a specific post type
- Header image doesn’t show up on page
- How to get name and email value from a custom form and add it to campaign monitor subscriber list?
- Custom Link In WordPress Media “Attachment Details” Upload Screen
- “Static” pages within a theme
- Custom WordPress SQL Query 4 posts per custom taxonomy
- Prevent posts from being published if the ‘Uncategorized’-category or no category is selected
- Post interior margin in twenty eleven theme
- Where did I put this one line of css?