• macra

    (@macra)


    I am using the custom content shortcode plugin in conjunction with ‘ultimate member’to create a directory listing. In the basic listing I’m using the array shortcode to display the contents of a custom field that is an array like this.

    [array user_field=”listing_category” debug=true] [field “1”] , [field “2”][/array]

    In debug mode the list shows the contents of the array as thus;

    Array
    (
    [0] => Baby
    [1] => Electronics and telecom
    [2] => Gifts and flowers
    )

    However, if I add [field “0”] or [field 0] to the list, I get the fatal memory error;

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /home/waitara/public_html/2016/wp-includes/shortcodes.php on line 214

    I’ve become quite frustrated trying to resolve this.
    Any suggestions?

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Thread Starter macra

    (@macra)

    I changed the shortcode to output an unordered list as follows;

    [array user_field=”listing_category” debug=true ]

    • [field value]
    • [/array]

      and while it does display all of the array contents including the ‘0’ data, it adds them all as one list item like this;

      •BabyElectronics and telecomGifts and flowers

      If I add ‘each=true’ to the array shortcode it just displays the first letter of each array item.

      • B
      • E
      • G

      etc.

Viewing 1 replies (of 1 total)

The topic ‘Memory error using [array]’ is closed to new replies.