Robert Safran

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Same Issue as: code deprecated in Functions.php #1298159
    Robert Safran
    Participant

    This second functions snippet contains the modifications from my developer.

    /*Original function*/
    function episode_cat_sb() {
    ob_start();
    $event_cat_ids = array();
    if ( $event ) {
    $event_cats = wp_get_object_terms( $event->ID, TribeEvents::TAXONOMY );
    foreach ( $event_cats as $event_cat ) {
    $event_cat_ids[] = $event_cat->term_id;
    }
    } else {
    $event_cats = array();
    }
    $args = array(
    ‘hide_empty’ => false,
    ‘orderby’ => ‘name’,
    ‘order’ => ‘ASC’,
    ‘exclude’ => $event_cat_ids,
    );

    $cats = get_terms( TribeEvents::TAXONOMY, $args );
    $cats = array_merge( $event_cats, $cats );
    $cats = apply_filters( ‘tribe_community_events_event_categories’, $cats );

    echo ‘<div class=”sidebar_episode_categories_list”>’;

    foreach ($cats as $cat) {
    echo ‘<div class=”sidebar_episode”><a href=”‘;
    echo home_url();
    echo ‘/episodes/category/’.esc_attr($cat->slug).’/?tribe_paged=1&tribe_event_display=past”‘;
    echo ‘>’.esc_attr($cat->slug).’</div>’; }

    echo ‘</div>’;

    return ob_get_clean();

    }

    /*The new working function*/
    function episode_cat_sb() {
    ob_start();
    $event_cat_ids = array();
    $event = array();
    if ( $event ) {
    $event_cats = wp_get_object_terms( $event->ID, Tribe__Events__Main::TAXONOMY );
    foreach ( $event_cats as $event_cat ) {
    $event_cat_ids[] = $event_cat->term_id;
    }
    } else {
    $event_cats = array();
    }
    $args = array(
    ‘hide_empty’ => false,
    ‘orderby’ => ‘name’,
    ‘order’ => ‘ASC’,
    ‘exclude’ => $event_cat_ids,
    );

    $cats = get_terms( Tribe__Events__Main::TAXONOMY, $args );
    $cats = array_merge( $event_cats, $cats );
    $cats = apply_filters( ‘tribe_community_events_event_categories’, $cats );

    echo ‘<div class=”sidebar_episode_categories_list”>’;

    foreach ($cats as $cat) {
    echo ‘<div class=”sidebar_episode”><a href=”‘;
    echo home_url();
    echo ‘/episodes/category/’.esc_attr($cat->slug).’/?tribe_paged=1&tribe_event_display=past”‘;
    echo ‘>’.esc_attr($cat->slug).’</div>’; }

    echo ‘</div>’;

    return ob_get_clean();

    }

    in reply to: Same Issue as: code deprecated in Functions.php #1297640
    Robert Safran
    Participant

    My wonderful web developer resolved all the issues in our functions.php file. All is working now on WordPress 4.8.

    in reply to: Same Issue as: code deprecated in Functions.php #1297199
    Robert Safran
    Participant

    I updated all occurrences of TribeEvents in my custom functions.php file with Tribe__Events__Main and it didn’t make any difference. Not sure what else I can do.

    Here’s the function that includes line 1388 which is the if ($event ) {

    function episode_cat_sb() {
    ob_start();
    $event_cat_ids = array();
    if ( $event ) {
    $event_cats = wp_get_object_terms( $event->ID, Tribe__Events__Main::TAXONOMY );
    foreach ( $event_cats as $event_cat ) {
    $event_cat_ids[] = $event_cat->term_id;
    }
    } else {
    $event_cats = array();
    }
    $args = array(
    ‘hide_empty’ => false,
    ‘orderby’ => ‘name’,
    ‘order’ => ‘ASC’,
    ‘exclude’ => $event_cat_ids,
    );

    $cats = get_terms( TribeEvents::TAXONOMY, $args );
    $cats = array_merge( $event_cats, $cats );
    $cats = apply_filters( ‘tribe_community_events_event_categories’, $cats );

    echo ‘<div class=”sidebar_episode_categories_list”>’;

    foreach ($cats as $cat) {
    echo ‘<div class=”sidebar_episode”><a href=”‘;
    echo home_url();
    echo ‘/episodes/category/’.esc_attr($cat->slug).’/?tribe_paged=1&tribe_event_display=past”‘;
    echo ‘>’.esc_attr($cat->slug).’</div>’; }

    echo ‘</div>’;

    return ob_get_clean();

    }

Viewing 3 posts - 1 through 3 (of 3 total)