noob questions – field visibility, categories, security

Home Forums Calendar Products Community Events noob questions – field visibility, categories, security

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1299659
    Lou
    Participant

    I have a few questions I can’t immediately discern about Community Events. Not sure if you would have preferred three separate topics, but I didn’t want to clog up the forum so I chose this way to state these questions.

    • I’d like to pick and choose which custom fields are shown, or maybe none at all. I know since I have control over my theme I can change the class tribe-section-custom-fields to display:none but it would be nice to have high level way to pick/choose if these are shown and which ones are shown
    • Similar to the custom field, and possibly more important, web site administrator may want ability to control which categories are visible
    • I want to use the visual editor so the user can put in lists, etc., but I worry that giving the user text access might open a security hole. Is the html user enters into the text window sanitized, e.g., are [script] tags removed? — actually after typing this I tested and script tag attempt gave 403 error so that’s good — are the allowed tags listed somewhere?
    #1299670
    Lou
    Participant

    also noticed there’s no way to set to show google maps link. It would be nice to allow that to be configurable by the administrator

    #1299671
    Lou
    Participant
    #1300743
    Andras
    Keymaster

    Hello Lou, welcome back!

    Thanks for your concern about clogging the forums. We do get lots of traffic nowadays.

    Having questions in one thread is ok, definitely easier to answer them like this. However, if you have issues of bugs with the plugin, then opening separate topics is recommended so 1) we can keep things clean and straight; 2) all issues get dedicated attention.

    Let me try to answer the questions for you.

    Iā€™d like to pick and choose which custom fields are shown, or maybe none at all. I know since I have control over my theme I can change the class tribe-section-custom-fields to display:none but it would be nice to have high level way to pick/choose if these are shown and which ones are shown

    If you are referring to the single event page and showing it on the front-end, then this is possible. If you don’t set a value for an additional field, then it will not show up.

    If you would like this as a functionality for the community events submit page, then I have to disappoint you unfortunately. This is not available at the moment.

    If you think that is something you would like as a feature I encourage you to visit our User Voice Page and either upvote an existing request or make a new request there.

    Similar to the custom field, and possibly more important, web site administrator may want ability to control which categories are visible

    Really sorry, the same thing as above.

    I will try to check with my colleagues if maybe it is possible with a filter or something, but this can take some time.

    Is the html user enters into the text window sanitized? […] are the allowed tags listed somewhere?

    Basically the tags that you see on the toolbar of the editor are the ones that are allowed. The rest is cut away to the best of my knowledge.

    I hope this clarifies.

    Cheers,
    Andras

    #1300745
    Lou
    Participant

    Thanks. Yes was talking about the community/add page. We decided to simply hide the custom fields and categories with css for now. I’ll visit the user voice page to ask for or upvote these features.

    #1300747
    Andras
    Keymaster

    Hi Lou,

    Meanwhile a teammate was kind enough to draft the below snippet for the categories:

    function tribe_dropdown_term_args_modify( WP_Term_Query $term_query ) {
    remove_action( 'pre_get_terms', 'tribe_dropdown_term_args_modify' );
    // @todo modify the term query via $term_query->query_vars['...']
    }
    function tribe_dropdown_term_args_listen() {
    add_action( 'pre_get_terms', 'tribe_dropdown_term_args_modify' );
    }
    add_action( 'wp_ajax_tribe_dropdown', 'tribe_dropdown_term_args_listen', 5 );
    add_action( 'wp_ajax_nopriv_tribe_dropdown', 'tribe_dropdown_term_args_listen', 5 );

    You could use a pattern like this, but you’d need to figure out what query vars to set/change/remove.

    Hope this helps.

    Cheers,
    Andras

    #1300750
    Andras
    Keymaster

    A bit extended:

     

    function tribe_dropdown_term_args_modify( WP_Term_Query $term_query ) {
        remove_action( 'pre_get_terms', 'tribe_dropdown_term_args_modify' );
    
        if ( ! is_array( $term_query->query_vars['exclude'] ) ) {
            return;
        }
    
        $term_query->query_vars['exclude'] = array_merge(
            $term_query->query_vars['exclude'],
            array( 1, 2, 3 ) // Update to the term IDs you wish to exclude
        );
    }
    
    function tribe_dropdown_term_args_listen() {
        add_action( 'pre_get_terms', 'tribe_dropdown_term_args_modify' );
    }
    add_action( 'wp_ajax_tribe_dropdown', 'tribe_dropdown_term_args_listen', 5 );
    add_action( 'wp_ajax_nopriv_tribe_dropdown', 'tribe_dropdown_term_args_listen', 5 );

    You need to add your category IDs in that array in the middle.

    Note that this is a quick draft and hasn’t been tested, but should get you started.

    Cheers,
    Andras

    #1300764
    Lou
    Participant

    Awesome, thanks!

    #1301051
    Andras
    Keymaster

    You’re very welcome.

    Since you marked this ticket resolved I am going to close it, but if you need anything else related to this topic or another please post a new one in the forum and we will be happy to help you out.

    Cheers,
    Andras

    PS: If you like our plugins, and you didn’t yet do so šŸ™‚ we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/plugin/the-events-calendar/reviews/

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. šŸ™‚ If you can spare a few words, that’s even better. Doublethanks!

     

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘noob questions – field visibility, categories, security’ is closed to new replies.