WordPress.org

Ready to get started?Download WordPress

Forums

Ultimate Post Type Manager
Getting string 'xydac-null' (4 posts)

  1. Hector
    Member
    Posted 2 years ago #

    I am iterating to echo the contents of Checkboxes custom field. At the end I keep getting a string "xydac-null". I even did a var_dump and it is physically a string. Any clues?

    Also, does anyone know why v 1.5 is not available for download from the other versions page?

    http://wordpress.org/extend/plugins/ultimate-post-type-manager/

  2. XYDAC
    Member
    Plugin Author

    Posted 2 years ago #

    It's fixed in recent version.
    Please check it out and also let me know.

    Regards,
    -Xydac

  3. Hector
    Member
    Posted 2 years ago #

    Hi Xydac. Thanks for the quick reply.

    I have upgraded but the string is still present. I even re-saved the post hoping it would somehow overwrite the value, no luck.

    This is my code:

    $ammenities = get_post_meta( $post->ID, 'ammenities', true );
    
             foreach ($ammenities as $i => $value) {
              echo implode(", ", $value);
             }

    The following in the changelog intrigues me, can you tell me how to use it?

    Added function xydac_get_post_meta to access values directly with php

  4. XYDAC
    Member
    Plugin Author

    Posted 2 years ago #

    The best way to get data is by using shortcodes, it helps the developer to customize the data in the he wants and deliver it to the user.
    But still if you would want to use the native php/WordPress function to get the output then just replace the get_post_meta() function call with xydac_get_post_meta() all you need to change is function name and leaving the rest to same.
    The function returns the value part if the content is an array, else it returns the value itself.
    For the implementation of checkbox you can check out the output function in fieldtypes/class-checkbox.php.

    You are getting the same string again because you are not using the shortcode for getting the value.

    I would recommend using the shortcode, and even if you want to use it in template file as php code or anywhere else as php code then u can use the WordPress function to execute shortcode do_shortcode().

    Regards,
    -Xydac

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic