• I’d like to provide some custom display logic to only let donors of our Friends of Pods to submit ideas and vote on them. I have that already done via a proxy shortcode but I’d like to be able to call enqueue_frontend_styles and force the enqueue myself without requiring the shortcode detection. Either a new argument or a filter to force the enqueue would be helpful here.

    Side note: The pro link to your site /pro has a 404.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author James Welbes

    (@highprrrr)

    Thanks Scott, we’ll look into this!

    Plugin Author James Welbes

    (@highprrrr)

    Hey Scott!

    We’ve added some filters that allow you to add your own custom conditional logic to choose when to display the shortcode content.

    The filters are:

    roadmapwp_new_idea_form_shortcode
    roadmapwp_display_ideas_shortcode
    roadmapwp_roadmap_shortcode
    roadmapwp_roadmap_tabs_shortcode

    an example of the filter in action:

    function restrict_shortcode_to_user_james($display_shortcode, $user_id) {
        // Get the current user's data
        $user_info = get_userdata($user_id);
    
        // Check if the user exists and the username is 'james'
        if ($user_info && strtolower($user_info->user_login) === 'james') {
            // Allow displaying the shortcode only for user 'james'
            return true;
        } else {
            // Restrict displaying the shortcode for anyone else
            return false;
        }
    }
    
    
    add_filter('roadmapwp_roadmap_shortcode', 'restrict_shortcode_to_user_james', 10, 3);
    

    This would only display the content of the of the roadmap shortcode to users with the username of “james”.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom display logic, ability to enqueue assets manually’ is closed to new replies.