WordPress.org

Ready to get started?Download WordPress

Forums

Pods - Custom Content Types and Fields
[resolved] Get Unique Field Message From Before Save Existing Post (5 posts)

  1. Chamath
    Member
    Posted 7 months ago #

    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 ?

    http://pastebin.com/fdZ94q4v - this code is not working extend existing post custom unique field.

    http://wordpress.org/plugins/pods/

  2. Josh Pollock
    Member
    Plugin Author

    Posted 7 months ago #

    Chamath-

    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,
    Josh

  3. Chamath
    Member
    Posted 7 months ago #

    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,
    http://imm.io/1lqtN

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

    like this.
    http://imm.io/1lquJ

    trying to do is check field value uniqueness pre-save post.
    http://imm.io/1lqvu

    i think same issue is discuss here.
    https://github.com/pods-framework/pods/issues/1297

    Please help me to fix this.

    Thanks,

  4. Josh Pollock
    Member
    Plugin Author

    Posted 7 months ago #

    Chamath-

    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?

    -Josh

  5. Chamath
    Member
    Posted 7 months ago #

    I found an alternative solution for this. used ACTs.

    Thanks for the help.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags