• Resolved ravi642

    (@ravi642)


    Currently plugin disable the voting when status is changed from open to any other status, but my requirement is this.

    I want to enable voting option when status is changed to any other status like Reviewed or Approved. and disable voting when status is open.

    Can we do that?

    All suggestions are welcomed!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @ravi642,

    Thanks for your enquiry. In the plugin settings, in the FAQ section, please see “I am a developer, do you provide any filters?” and we have a filter:

    Allowed Idea Statuses for Voting
    The only allowed statuses for voting are open ideas. You can use the filter to expand this to other statuses.

    add_filter( "idea_push_voting_statuses", "idea_push_voting_statuses_callback", 10, 1 ); 
    function idea_push_custom_field_separator_callback( $statuses ) { 
      //this will allow voting for the reviewed status as well 
      array_push($statuses,'reviewed'); return $statuses; 
    }

    So the code needs to go in your themes functions.php file and you may need to change/add the status mentioned in the function as well. At the moment it is set to reviewed, so voting is enabled on reviewed status.

    Thanks,

    Thread Starter ravi642

    (@ravi642)

    @northernbeacheswebsites

    Thank you for your time.

    I tried implementing above code snippet with correct function name:-
    add_filter( "idea_push_voting_statuses", "idea_push_voting_statuses_callback", 10, 1 );function idea_push_voting_statuses_callback($statuses){array_push($statuses,'reviewed'); return $statuses;}

    it seems, this action idea_push_voting_statuses is not working .
    I tried all means to check but it didn’t work.

    Can you just look over it?

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @ravi642,

    I can confirm this code works ok. As mentioned the code will enable voting of the reviewed status. You will need to change “reviewed” to whatever status you want to enable voting for.

    Thanks,

    Thread Starter ravi642

    (@ravi642)

    Hi @northernbeacheswebsites,

    I am sorry for troubling you, I may be doing something wrong.

    I am implementing the code in theme functions.php file itself. All other filters provided in the support FAQ are working but this filter isn’t working.

    Am i implementing it correctly?

    here is the screenshot of code implemented in the theme. Other filters are working but this commented section of code(for enabling the voting for approved/reviewed status) isn’t working.

    Thanks for your Help

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @ravi642,

    The code is commented out, so it’s not going to work if it’s commented out. You see how the colour of the text in your screenshot is in that gold colour, this means it’s commented out. So you need to remove the 2 forward slashes // at the start of each line to uncomment the code. I am sorry if that’s super obvious and you have tried that, but I just need to say that as who knows.

    Apart from that it looks fine. If you want the code to enable voting on both approved and reviewed statuses, you would make the line look like this:

    array_push($statuses,'reviewed','approved');

    Thanks,

    Thread Starter ravi642

    (@ravi642)

    Hi @northernbeacheswebsites

    I know that super obvious thing.

    By the way thanks for you Kind helps.

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Haha no worries. I am glad that resolved the issue ??

    freakennl

    (@freakennl)

    I am trying to add this filter as well, but gives me “Critical” response. Tried the code in this form as well as from the support part from the plugin. Also tried different statuses. But still get the critical error ??

    Any suggestions?

    Kind regards, Vincent

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @freakennl

    As you are a pro user, I am going to send you an email about this now. Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Enabling Voting when idea is approved’ is closed to new replies.