WordPress.org

Ready to get started?Download WordPress

Forums

YOP Poll
Regarding the view Polls (4 posts)

  1. akhtarali441
    Member
    Posted 7 months ago #

    Hi, Thanks for Great Plugin.

    I am using version 4.9 , when a registered user add a poll and then view polls then all other polls are viewed. i only want to view only those polls which are added by current user.

    please help me.

    thanks

    http://wordpress.org/plugins/yop-poll/

  2. YOP
    Member
    Plugin Author

    Posted 7 months ago #

    Hi akhtarali441,

    Edit inc/yop_poll_model.php and in
    public static function get_yop_polls_filter_search right after $sql_search = ' ) ';

    add

    global $current_user;
    $user_roles = $current_user->roles;
    $user_role = array_shift($user_roles);
    if ($user_role != 'administrator')
    $sql_search .= 'AND poll_author = ' . $current_user->ID;

    This way the users will be able to see only their own polls (except for the admins who can view all polls).

    Regards,

    YOP Team

  3. akhtarali441
    Member
    Posted 7 months ago #

    Thanks A lot ..Again very very thanks to you..

    I have another question if i want to Filter the Polls According to This week, last week, this month, last month what would i do..

    please also help me in this post.. thanks in advance

  4. YOP
    Member
    Plugin Author

    Posted 7 months ago #

    Hey akhtarali441,

    We will look into this and try to make this option available in the future.

    Best wishes,

    YOP Team

Reply

You must log in to post.

About this Plugin

About this Topic

Tags