• Hi,

    Great plugin.

    I am using

    editable_post_meta( $wp_query->queried_object->ID, 'test_key', 'input' );

    to edit custom fields (which are displayed in a html table).

    The custom fields contain numbers, hence I would like to use number_format to give the numbers a format. I tried this:

    number_format(editable_post_meta( $wp_query->queried_object->ID, 'test_key', 'input' ), 0, ',', '.');

    However, somehow an extra zero is added (100 gets 1000). In firebug I see the zero is outside the fee span class. What is the proper way to use number_format with editable_post_meta?

    Thanks for your help.

    http://wordpress.org/extend/plugins/front-end-editor/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author designsimply

    (@designsimply)

    Can you do number_format on the data separate before you call editable_post_meta ?

    Thread Starter Pepperbase

    (@pepperbase)

    Hi,

    I have a new approach using jQuery. I have created a numberformat function which I like to run when the ajax call to save data is complete. This is working:

    jQuery(document).ready(function() {
        jQuery( document ).ajaxComplete(function() {
    	numberformat('some_custom_field_name');
        }
    });

    However, this code runs on every ajax call. How can I select the ajax calls from the front end editor to edit and save data? From jQuery I understand I can insert an if statement, but I cannot find the right handler to select the ajax calls, see below

    jQuery(document).ready(function() {
        jQuery( document ).ajaxComplete(function() {
            if ( "#some-fee-ajax-handler..." ) {
    	     numberformat('some_custom_field_name');
             }
        }
    });

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘editable custom field and number format’ is closed to new replies.