• Hi, is there a way to block participant link record after let’s say 14 days from registration or have field added “Active”: yes/no, so lets say if I dont want user to be able to see/edit his details after this kind of trigger.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Roland Barker

    (@xnau)

    This kind of thing is possible, it requires that you be familiar with how to use the WordPress cron to run a custom script in the background. This is the only way to do it because you need a way to independently check a record’s status and make changes.

    To deactivate the record, you have the right idea, but to implement it you’d need to use a custom template that shows some kind of message instead of the editable record.

    Thread Starter slawekwlodek

    (@slawekwlodek)

    thanks for reply, ok, I am familiar with scripting and crone, but could you explain/give an idea with template bit? basically, I want make private link https://www.website.net/?page_id=123&pid=SDFD213 shows something like “data unavailable to view or edit” or whatever after some trigger where now it will display user data and give him ability to amend his records all the time until his private ID is changed. I want to make it works this way that once user is approved etc is not able to see or at least edit his data. but we have 2 steps approval system – first basic necessary data, once we happy with initial form/data we send this link to ask for more details – once they add more data and we accept it we want to block user to see or edit his data in the future. I was thinking about read_only property of the field – but this will not work on second stage once initial form/data is added at first stage.

    Sorry for long post but I am trying to explain as much as possible what I am about. Thanks.

    Plugin Author Roland Barker

    (@xnau)

    OK, well you’re going to have to figure out how to test the precise conditions you want met in order to show the editable record, but setting up the template is simple. For example, in the default template for the [pdb_record] shortcode, there is a line:

    if ( !empty( $this->participant_id ) ) :

    This tests for the validity of the record ID before displaying the editable record. You can add another test to show your custom content if you want to prevent the user from editing their record…for example:

    if ( your_custom_function_dont_allow_editing( $this->participant_id ) ) :
    
    // print your message
    
    elseif ( !empty( $this->participant_id ) ) :
    
    // rest of the template as-is
    
    • This reply was modified 4 years, 9 months ago by Roland Barker.
    Thread Starter slawekwlodek

    (@slawekwlodek)

    ok, that make sense now as I catch how it works (I mean, I was looking at this from different point of view – had different picture in my head), many thanks for a tip, now I know where to go and I will give it a try.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Participant link deactivation’ is closed to new replies.