All menus show when Articles tab is clicked

Closed
REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme June 01, 2022
Login to reply
Amanda Clarke-Peterson
1 year ago

I updated ReHub and that seemed to resolve the issue. Thank you for your help!! :D

Igor Sunz Support Agent
1 year ago

it can be related to latest wordpress update. We fixed it in our theme
update, but I can't tell you about custom plugins, I recommend to write to
author of plugin

Amanda Clarke-Peterson
1 year ago

Ok. Thanks Igor. I have done that.

But now the Articles tab is completely missing from all of our Shops. Can you help us figure out why? The only thing that happened is I experienced a DDoS attack and my host decided to move my servers. I slept for about 4 hours and when I awoke the Articles tab was gone. 

However, I cannot test that it is fixed without the Articles tab, since when I clicked it the other menu items came out. And I do not know why it is now missing. Hopefully you can help me pinpoint the problem.

I've had code added functions.php to the childtheme for awhile now. I will share the custom code which effects the Articles, it might be irrelevant - but if I have wrong code here things can go sideways. 

/*Add Articles to Shop*/

add_action( 'wcfmmp_before_store_article', function( $store_id, $store_info ) {

 ?>

 <div class="main-side no_bg_wrap clearfix<?php if (rehub_option('blog_archive_layout') == 'gridfull_blog') : ?> full_width<?php endif ;?>">

 <div>

 <?php

}, 50, 2);



/*Rehub Add Store Articles*/

add_action( 'wcfmmp_store_article_template', function() {

 ?>

 <?php if (rehub_option('rehub_framework_archive_layout') == 'blog') : ?>

   <?php include(rh_locate_template('inc/parts/query_type2.php')); ?>

 <?php elseif (rehub_option('rehub_framework_archive_layout') == 'news_list') : ?>

   <?php $type='2'; ?>

   <?php include(rh_locate_template('inc/parts/query_type1.php')); ?>

 <?php elseif (rehub_option('rehub_framework_archive_layout') == 'community_list') : ?>

   <?php include(rh_locate_template('inc/parts/query_type1.php')); ?>                    

 <?php elseif (rehub_option('rehub_framework_archive_layout') == 'grid' || rehub_option('rehub_framework_archive_layout') == 'gridfull') : ?>

   <?php include(rh_locate_template('inc/parts/query_type3.php')); ?>   

 <?php elseif (rehub_option('rehub_framework_archive_layout') == 'column_grid' || rehub_option('rehub_framework_archive_layout') == 'column_grid_full') : ?>

   <?php include(rh_locate_template('inc/parts/column_grid.php')); ?>                   

 <?php else : ?>

   <?php $type='2'; ?>                     

   <?php include(rh_locate_template('inc/parts/query_type1.php')); ?>  

 <?php endif ;?>

 <?php

});


add_action( 'wcfmmp_store_article_template_none', function() {

 ?>

 <h5><?php _e('This Creative has yet to post any Articles! Please check for content again later!', 'rehub_framework'); ?></h5>

 <?php

});


add_action( 'wcfmmp_after_store_article', function( $store_id, $store_info ) {

 ?>

  </div><div class="clearfix"></div>

  <?php

 rehub_pagination();

 echo '</div>';

}, 50, 2);


add_filter( 'wcfm_is_allow_store_articles', '__return_true' );


/*Send ARTICLE to Shop FOLLOWER - EMAIL*/

add_action('woocommerce_thankyou', function($order_id) {

    global $wpdb, $WCFM;

    if ( ! $order_id ) return;

    if( ! get_post_meta( $order_id, '_thankyou_action_done', true ) ) {

        $order = wc_get_order( $order_id );

        if ( !$order->get_user_id() ) return;

        $customer_id = $order->get_user_id();


        $vendor_list = array();

        $items = $order->get_items( 'line_item' );

        if( !empty( $items ) ) {

            foreach( $items as $item ) {

                $line_item = new WC_Order_Item_Product( $item );

                $product_id = $line_item->get_product_id();

                if( $product_id ) {

                    $vendor_id = wcfm_get_vendor_id_by_post( $product_id );

                    if( $vendor_id && !in_array($vendor_id, $vendor_list) ) {

                        $vendor_list[] = $vendor_id;

                    }

                }

            }

        }

        if(!empty($vendor_list)) {

            foreach( $vendor_list as $vendor_id ) {

                if( !apply_filters( 'wcfm_validate_user_can_follow_vendor', true, $customer_id, $vendor_id ) ) {

                    continue;

                }

                $user_data = get_userdata( $customer_id );

                $vendor_data = get_userdata( $vendor_id );


                $followers_arr = (array) get_user_meta( $vendor_id, '_wcfm_followers_list', true );

                if( !in_array($customer_id, $followers_arr) ) {

                    $followers_arr[] = $customer_id;

                    update_user_meta( $vendor_id, '_wcfm_followers_list', $followers_arr );


                    $vendor_display_name = esc_sql( $vendor_data->display_name );

           $user_display_name = esc_sql( $user_data->display_name );

                    // Update WCfM Followers Table

                    $wcfm_add_follower = "INSERT into {$wpdb->prefix}wcfm_following_followers 

                                    ( `user_id`, `user_name`, `user_email`, `follower_id`, `follower_name`, `follower_email`, `notify` )

                                    VALUES

                                    ( {$vendor_id}, '{$vendor_display_name}', '{$vendor_data->user_email}', {$customer_id}, '{$user_display_name}', '{$user_data->user_email}', 1 )";

                    $wpdb->query($wcfm_add_follower);

                    // Direct message

                    $wcfm_messages = apply_filters( 'wcfm_vendor_new_follower_message', __( 'Congratulations! You have a NEW Follower!', 'wc-frontend-manager-ultimate' ), $customer_id, $vendor_id );

                    $WCFM->wcfm_notification->wcfm_send_direct_message( -1, $vendor_id, 1, 0, $wcfm_messages, 'new_follower' );

                }


                $user_following_arr = (array) get_user_meta( $vendor_id, '_wcfm_following_list', true );

                if( !in_array($vendor_id, $user_following_arr) ) {

                    $user_following_arr[] = $vendor_id;

                    update_user_meta( $customer_id, '_wcfm_following_list', $user_following_arr );

                }

                

            }

        }


        $order->update_meta_data( '_thankyou_action_done', true );

        $order->save();

    }

}, 10, 1);


add_action('after_wcfm_articles_manage_meta_save', function($article_id) {

    global $WCFM;

    $article = get_post($article_id);

    $vendor_id = $article->post_author;

    $vendor_id = apply_filters('wcfm_current_vendor_id', $vendor_id);

    if(!$vendor_id) return;


    $article_status = get_post_status( $article_id );

    if( $article_status == 'pending' ) {

       $wcfm_review_article_notified = get_post_meta( $article_id, '_wcfm_review_article_notified', true );

        if( !$wcfm_review_article_notified ) {

   $author_id = $vendor_id;

   $author_is_admin = 0;

   $author_is_vendor = 1;

   $message_to = 0;

   $wcfm_messages = sprintf( __( 'An Article <b>%s</b> is awaiting review', 'wc-frontend-manager' ), '<a class="wcfm_dashboard_item_title" href="' . get_wcfm_articles_manage_url( $article_id ) . '">' . get_the_title( $article_id ) . '</a>' );

            $WCFM->wcfm_notification->wcfm_send_direct_message( $author_id, $message_to, $author_is_admin, $author_is_vendor, $wcfm_messages, 'article_review', apply_filters( 'wcfm_is_allow_review_article_notification_email', true ) );

   update_post_meta( $article_id, '_wcfm_review_article_notified', 'yes' );

   do_action( 'wcfm_after_review_article_by_vendor', $article_id, $vendor_id );

  }

    } else {

        if( $article_status != 'publish' ) return;

        $wcfm_new_article_notified = get_post_meta( $article_id, '_wcfm_new_article_notified', true );

       if( !$wcfm_new_article_notified ) {

   $author_id = $vendor_id;

   $author_is_admin = 0;

   $author_is_vendor = 1;

   $message_to = 0;

   $wcfm_messages = sprintf( __( 'A new article <b>%s</b> is added by <b>%s</b>', 'wc-frontend-manager' ), '<a class="wcfm_dashboard_item_title" href="' . get_permalink( $article_id ) . '">' . get_the_title( $article_id ) . '</a>', wcfm_get_vendor_store( $vendor_id ) );

   $WCFM->wcfm_notification->wcfm_send_direct_message( $author_id, $message_to, $author_is_admin, $author_is_vendor, $wcfm_messages, 'new_article', apply_filters( 'wcfm_is_allow_new_article_notification_email', false ) );

   update_post_meta( $article_id, '_wcfm_new_article_notified', 'yes' );

   do_action( 'wcfm_after_new_article_by_vendor', $article_id, $vendor_id );

  }

    }

});



//Add Filter to remove Emails for Products - Adult_Mature

add_filter( ‘wcfm_allowed_taxonomies’, function( $is_Allow, $taxonomy, $term_id ) { if( wcfm_is_vendor() && in_array( $term_id, array( 1505 ) ) ) { $is_Allow = false; } return $is_Allow; }, 750, 3 );


add_filter('wcfm_message_types', function($message_types) {

    $article_types = array(

        'article_review' => 'Article Review',

        'new_article' => 'New Article',

    );

    return $message_types + $article_types;

}, 200);


add_action('wcfm_after_new_article_by_vendor', function($article_id, $vendor_id) {

    global $wpdb, $WCFM;

    $is_wcfm_followers_notified = get_post_meta( $article_id, '_wcfm_followers_notified', true );

    if( $is_wcfm_followers_notified ) return;

    $sql = "SELECT * FROM {$wpdb->prefix}wcfm_following_followers WHERE `user_id` = " . $vendor_id;

    $vendor_followers = $wpdb->get_results( $sql );

    if( !empty( $vendor_followers ) ) {

        foreach( $vendor_followers as $vendor_follower ) {

            if( $vendor_follower->follower_email ) {

                if( !defined( 'DOING_WCFM_EMAIL' ) ) 

                    define( 'DOING_WCFM_EMAIL', true );

                

                $notificaton_mail_subject = "{site_name}: " . __( "An Independent Shop you FOLLOW posted an Article!", "wc-frontend-manager-ultimate" ) . " - {post_title}";

                $notification_mail_body = '<br/>' . __( 'Hi', 'wc-frontend-manager' ) . '{follower_name}' .

                                            ',<br/><br/>' . 

                                            __( 'A new post was submitted by Independent Shop', 'wc-frontend-manager-ultimate' ) . ' <b>{vendor_store}</b>' . 

                                            '<br/><br/>' .

                                            sprintf( __( 'To view the Article, click the title of the post: %s{post_title}%s.', 'wc-frontend-manager-ultimate' ), '<a href="{post_url}">', '</a>' ) .

                                            sprintf( __( '<BR> To change the Independent Shops you follow, visit the %sAccount page%s', 'wc-frontend-manager-ultimate' ), '<a href="https://makyn.me/account/">','</a>' ) .

                                            '<br /><br/>' . __( 'Thank You!', 'wc-frontend-manager' ) .

                                            '<br/><br/>';

                                                         

                $subject = str_replace( '{site_name}', get_bloginfo( 'name' ), $notificaton_mail_subject );

                $subject = apply_filters( 'wcfm_email_subject_wrapper', $subject );

                $subject = str_replace( '{post_title}', get_the_title( $article_id ), $subject );

                $message = str_replace( '{post_title}', get_the_title( $article_id ), $notification_mail_body );

                $message = str_replace( '{follower_name}', $vendor_follower->follower_name, $message );

                $message = str_replace( '{vendor_store}', $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( $vendor_id ), $message );

                $message = str_replace( '{post_url}', get_permalink( $article_id ), $message );

                $message = apply_filters( 'wcfm_email_content_wrapper', $message, __( "NEW Article by an Independent Shop on Makyn.me", "wc-frontend-manager-ultimate" ) );

                

                wp_mail( $vendor_follower->follower_email, $subject, $message );

            }

        }

    }

    update_post_meta( $article_id, '_wcfm_followers_notified', 'yes' );

}, 10, 2);

Igor Sunz Support Agent
1 year ago

Theme options-affiliate and deactivate option to hide expired

Ср, 1 июня 2022 г. в 05:45, Sizam Support Help Desk <
sizamtheme+Xr3BOMd4B2aN40vgVbYQ@mail.support-hub.io>:

Amanda Clarke-Peterson
1 year ago

Hi!

With only Rehub, Rehub Framework, WooCommerce, and WCFM Suite of plugins active - when Articles tab is clicked from Shop page - ALL Menu items show. Can you please help me resolve this?

Thanks in advance!

Additional Info

Link on page with issue: https://makyn.me/Shop/mandakyns/