@@ -78,42 +78,17 @@ public function __construct() {
7878 add_action ( 'rest_api_init ' , array ( $ this , 'appendUserMetaToRestAPI ' ) );
7979 add_action ( 'gigya_offline_sync_cron ' , array ( $ this , 'executeOfflineSyncCron ' ) );
8080 add_shortcode ( 'gigya_user_info ' , array ( $ this , 'shortcodeUserInfo ' ) );
81- add_filter ( 'the_content ' , array ( $ this , 'theContent ' ) );
8281 add_filter ( 'get_avatar ' , array ( $ this , 'getGigyaAvatar ' ), 10 , 5 );
8382 add_filter ( 'login_message ' , 'raas_wp_login_custom_message ' );
8483 add_filter ( 'cron_schedules ' , array ( $ this , 'getOfflineSyncSchedules ' ) );
8584
86- if ( gigya_comments_on () ) {
87- add_filter ( 'comments_template ' , [ $ this , 'commentsTemplate ' ] );
88- }
89-
9085 /* Plugins shortcode activation switches */
9186 require_once GIGYA__PLUGIN_DIR . 'features/gigyaPluginsShortcodes.php ' ;
9287 $ shortcodes_class = new gigyaPluginsShortcodes ();
9388
9489 add_shortcode ( 'gigya-raas-login ' , array ( $ shortcodes_class , 'gigyaRaas ' ) );
9590 add_shortcode ( 'gigya-raas-profile ' , array ( $ shortcodes_class , 'gigyaRaas ' ) );
9691 add_shortcode ( 'gigya-social-login ' , array ( $ shortcodes_class , 'gigyaSocialLoginScode ' ) );
97-
98- $ comments_switch = get_option ( GIGYA__SETTINGS_COMMENTS );
99- if ( ! empty ( $ comments_switch ) and ( count ( $ comments_switch ) > 0 ) and ( $ comments_switch ['on ' ] == true or $ comments_switch ['on ' ] == '1 ' ) ) {
100- add_shortcode ( 'gigya-comments ' , array ( $ shortcodes_class , 'gigyaCommentsScode ' ) );
101- }
102- $ reaction_switch = get_option ( GIGYA__SETTINGS_REACTIONS );
103- if ( ! empty ( $ reaction_switch ) and ( count ( $ reaction_switch ) > 0 ) and ( $ reaction_switch ['on ' ] == true or $ reaction_switch ['on ' ] == '1 ' ) ) {
104- add_shortcode ( 'gigya-reactions ' , array ( $ shortcodes_class , 'gigyaReactionsScode ' ) );
105- }
106- $ share_switch = get_option ( GIGYA__SETTINGS_SHARE );
107- if ( ! empty ( $ share_switch ) and ( count ( $ share_switch ) > 0 ) and ( $ share_switch ['on ' ] == true or $ share_switch ['on ' ] == '1 ' ) ) {
108- add_shortcode ( 'gigya-share-bar ' , array ( $ shortcodes_class , 'gigyaShareBarScode ' ) );
109- }
110- $ gm_switch = get_option ( GIGYA__SETTINGS_GM );
111- if ( ! empty ( $ gm_switch ) and ( count ( $ gm_switch ) > 0 ) and ( $ gm_switch ['on ' ] == true or $ gm_switch ['on ' ] == '1 ' ) ) {
112- add_shortcode ( 'gigya-gm-achievements ' , array ( $ shortcodes_class , 'gigyaGmScode ' ) );
113- add_shortcode ( 'gigya-gm-challenge-status ' , array ( $ shortcodes_class , 'gigyaGmScode ' ) );
114- add_shortcode ( 'gigya-gm-leaderboard ' , array ( $ shortcodes_class , 'gigyaGmScode ' ) );
115- add_shortcode ( 'gigya-gm-user-status ' , array ( $ shortcodes_class , 'gigyaGmScode ' ) );
116- }
11792 /* End plugins shortcodes activation switches */
11893 }
11994
@@ -641,91 +616,9 @@ public function widgetsInit() {
641616 register_widget ( 'GigyaLogin_Widget ' );
642617 }
643618
644- /* Share Widget */
645- $ share_options = get_option ( GIGYA__SETTINGS_SHARE );
646- $ share_on = _gigParamDefaultOn ( $ share_options , 'on ' );
647- if ( ! empty ( $ share_on ) ) {
648- require_once GIGYA__PLUGIN_DIR . 'features/share/GigyaShareWidget.php ' ;
649- register_widget ( 'GigyaShare_Widget ' );
650- }
651-
652- /* Comment Widget */
653- $ comments_options = get_option ( GIGYA__SETTINGS_COMMENTS );
654- $ comments_on = _gigParamDefaultOn ( $ comments_options , 'on ' );
655- if ( ! empty ( $ comments_on ) ) {
656- require_once GIGYA__PLUGIN_DIR . 'features/comments/GigyaCommentsWidget.php ' ;
657- register_widget ( 'GigyaComments_Widget ' );
658- }
659-
660- /* Reactions Widget */
661- $ reactions_options = get_option ( GIGYA__SETTINGS_REACTIONS );
662- $ reactions_on = _gigParamDefaultOn ( $ reactions_options , 'on ' );
663- if ( ! empty ( $ reactions_on ) ) {
664- require_once GIGYA__PLUGIN_DIR . 'features/reactions/GigyaReactionsWidget.php ' ;
665- register_widget ( 'GigyaReactions_Widget ' );
666- }
667-
668- /* Gamification Widget */
669- $ gm_options = get_option ( GIGYA__SETTINGS_GM );
670- $ gm_on = _gigParamDefaultOn ( $ gm_options , 'on ' );
671- if ( ! empty ( $ gm_on ) ) {
672- require_once GIGYA__PLUGIN_DIR . 'features/gamification/GigyaGamificationWidget.php ' ;
673- register_widget ( 'GigyaGamification_Widget ' );
674- }
675-
676619 return true ;
677620 }
678621
679- /**
680- * Hook content alter.
681- *
682- * @param $content
683- *
684- * @return string $content
685- */
686- public function theContent ( $ content ) {
687- // Share plugin.
688- $ share_options = get_option ( GIGYA__SETTINGS_SHARE );
689- $ share_on = _gigParamDefaultOn ( $ share_options , 'on ' );
690- if ( ! empty ( $ share_on ) ) {
691- require_once GIGYA__PLUGIN_DIR . 'features/share/GigyaShareSet.php ' ;
692- $ share = new GigyaShareSet ();
693- $ content = $ share ->setDefaultPosition ( $ content );
694- }
695-
696- // Reactions plugin.
697- $ reactions_options = get_option ( GIGYA__SETTINGS_REACTIONS );
698- $ reactions_on = _gigParamDefaultOn ( $ reactions_options , 'on ' );
699- if ( ! empty ( $ reactions_on ) ) {
700- require_once GIGYA__PLUGIN_DIR . 'features/reactions/GigyaReactionsSet.php ' ;
701- $ reactions = new GigyaReactionsSet ();
702- $ content = $ reactions ->setDefaultPosition ( $ content );
703- }
704-
705- return $ content ;
706- }
707-
708- /**
709- * Hook comments_template.
710- *
711- * @param $comment_template
712- *
713- * @return string
714- */
715- public function commentsTemplate ( $ comment_template ) {
716- /* Spider trap.
717- * When a spider detect we render the comment in the HTML for SEO */
718- $ is_spider = gigyaCMS::isSpider ();
719- if ( ! empty ( $ is_spider ) ) {
720- /* Override default WP comments template with comment spider */
721- return GIGYA__PLUGIN_DIR . 'admin/tpl/comments-spider.tpl.php ' ;
722- }
723-
724- /* Override default WP comments template */
725-
726- return GIGYA__PLUGIN_DIR . 'admin/tpl/comments.tpl.php ' ;
727- }
728-
729622 /**
730623 * Hook AJAX Clean DB.
731624 */
0 commit comments