Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions inc/helper/plugin-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ function dwqa_advanced_ads_select_args( $args ) {
/** Facebook Comments **/
add_filter( 'get_post_metadata', 'dwqa_disable_wpdevart_facebook_comment', 10, 3 );
function dwqa_disable_wpdevart_facebook_comment( $value, $post_id, $meta_key ) {
if ('_disabel_wpdevart_facebook_comment' != $meta_key) {
return $value;
}

$dwqa_options = get_option( 'dwqa_options', array() );
if (
'_disabel_wpdevart_facebook_comment' == $meta_key
&&
(
'dwqa-question' == get_post_type( $post_id ) // is single question
||
'dwqa-answer' == get_post_type( $post_id ) // is single answer
||
(int) $dwqa_options['pages']['submit-question'] == (int) $post_id // is submit question page
||
(int) $dwqa_options['pages']['archive-question'] == (int) $post_id // is archive page
)
if (
'dwqa-question' == get_post_type( $post_id ) // is single question
||
'dwqa-answer' == get_post_type( $post_id ) // is single answer
||
(int) $dwqa_options['pages']['submit-question'] == (int) $post_id // is submit question page
||
(int) $dwqa_options['pages']['archive-question'] == (int) $post_id // is archive page
) {
$value = 'disable';
}
Expand All @@ -40,4 +40,4 @@ function dwqa_disable_facebook_comments_plugin( $content ) {
remove_filter('the_content', 'fbcommentbox', 100);
}
return $content;
}
}