If it’s just a simple tweak to the output string then just use str_replace.
$averagePricejson = "[[0,0],[1,39000],[2,62500],[3,80000]]";
$averagePricejson = str_replace( "]]", "],]", $averagePricejson);
echo $averagePricejson; // [[0,0],[1,39000],[2,62500],[3,80000],]
Related Posts:
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Loop increase number
- Foreach loop returning more than one item when querying taxonomy
- set object terms after some some time of published post – functions.php
- How to use a custom post type archive as front page?
- Display a query with multiple post types and same relationship on a single page
- Custom post status not working
- Date archives for custom post type
- How can I add dropdown widget/box to admin post page?
- Limit Authors to their Own Posts on front-end excluding admins
- Append taxonomy terms as class names in markup?
- Display children and grandchildren of a custom post type
- WP_Query search posts by custom post type and custom taxonomy
- Conditional to modify query results
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Loading all files within a directory
- Can’t get order_by meta_value_num to work properly
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- What’s the difference between same wp functions get_posts(); functions in different form?
- How to make sure content doesn’t display if selection is empty
- How to customize a permalink (URL) structure?
- Can I list a custom post type within another custom post type in the admin area?
- Set URL link to featured image of custom post type
- AJAX load more for different custom post type loops
- On update or create post redirect to current post position in list
- I need to add endpoint for wordpress categories
- creat filter with wp_query
- Redirect 404 page with ID in slug to associated page with same ID in slug
- WordPress wrapped added a span tag to every single p tag
- Display featured image from one CPT within another CPT query
- Hide a widget inside a div on specific type of post
- Redirect to another page using contact form 7? [closed]
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- categories should be available across all custom post types
- How can I group posts by months and years?
- custom post for slider
- Using wp_query to modify the loop in index.php for a CPT
- WP_Query Custom Post Type if Category ID Equals
- Assign category a default post type
- How to use a variable as a function name?
- How exclude or skip post type with get_next_post_link
- Different options per post type in WP_Query
- Show message when query has no posts
- Create short URL with auto 301 redirect
- Undefined $post in wp_query
- Is it possible to use array_walk() to append terms to an array of posts?
- Get current user id
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- post_content is stripping HTML when adding a new post? [closed]
- List latest post out of 2 custom post types
- Template code to split a post and print a custom field?
- Let users upload image(s) to the post from front end
- Post type Echo code is repeating on homepage
- Page that lists publications by classifying them by taxonomy
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom Form / Search with Custom Post Type Data
- php dynamic content inside shortcode
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Check that a slug is present in the get_terms request
- Pagination not working in custom post type. Help
- How to add specific terms in a custom post type?
- Assigning categories to custom post types via a front-end form; only works for native post type
- Limit custom post type to the authors only on front-end!
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- wp_post_delete is deleting all offices
- Create posts inside CPT post
- Persist meta box choices throughout all posts of same post type
- ACF field check value of field on all other articles
- Search result based on URL
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom Taxonomy – fields
- Custom Post By Category
- How to get the posts that my following users are liked?
- CPT post doesnt shows tags and category on backend admin page
- The most recent post of custom taxonomy
- Strange behavior on WP_query
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- can’t see categories in appearance-menu-categories
- Loop carousel slider in wordpress
- WP_Query function for custom post type
- Modify shortcode to work with custom taxonomies and slugs
- Function not pulling image or text from custom post type
- Values inside a custom field to determine which category posts to display
- Trying to combine multiple WordPress queries
- Pagination not working on homepage
- Custom Loop for custom post type. Compare by meta_value?
- Query Custom Post Type by Tag
- Code in custom widget queries all posts, when it should only query the current post
- How to manage wordpress knowledge base/wiki/posts collections
- How to string lines from the_content() hook in WordPress?
- Comments are not working on Custom Post Type
- Store custom post type with JSON content
- How to I add count of custom posts listed in a post as a prefix to its title
- how to display custom taxonomies in front page
- add_rewrite_rule not working with custom post type
- How do loop categories post from according in WordPress? is it impossible to solve this problem?