Support » Plugin: Pods - Custom Content Types and Fields » Get Unique Field Message From Before Save Existing Post

  • Resolved Chamath


    Create New process is OK.It is Already Working, But existing extend post unique field is not working perfectly.Some Data gone to Database without unique field value.

    I want add message when type same value in unique field and press publish button then popup message “this value to be unique”.

    it is not working correctly, error message will display but post data is add to the post.

    Please Help Me Quickly, How I fix this problem ? – this code is not working extend existing post custom unique field.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Josh Pollock



    I’m not exactly sure what your problem is, but I think it has to do with the use of pods_var in the first conditional. It would be really helpful to see this code in context so I understood what the variables being used where.

    What exactly are you trying to accomplish with the test 1 == pods_var( 'unique', $options[ 'options' ], 0 ) ? I’m not exactly sure, but I can’t see how it could return as 1, but I’m not sure since I don’t know what $options[ ‘options’ ] is. Please let me know and I’ll do my best to help.

    Take care,

    Hi Josh,

    I want to add existing post type to custom unique text field
    ( Business Directory Plugin – WP_Query based post type )
    ( ex:- Reference ID , Email )

    used this method,

    But the problem is its validate and give error and post data without unique field value.

    like this.

    trying to do is check field value uniqueness pre-save post.

    i think same issue is discuss here.

    Please help me to fix this.


    Plugin Contributor Josh Pollock



    I see what you are trying to do overall, and I think the issue is with the conditional 1 == pods_var( 'unique', $options[ 'options' ], 0 ) You’re looking for a parameter named unique, which I don’t think is what you actually want. Also what could $options[ 'options' ] be equal to?


    I found an alternative solution for this. used ACTs.

    Thanks for the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get Unique Field Message From Before Save Existing Post’ is closed to new replies.