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

  1. Hector
    Posted 5 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?


  2. XYDAC
    Plugin Author

    Posted 5 years ago #

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


  3. Hector
    Posted 5 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
    Plugin Author

    Posted 5 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().


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ultimate Post Type Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic