This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_ulike_custom_content_filter( $button, $content ){ | |
if ( in_the_loop() && is_main_query() && is_singular() && has_category( array('uncategorized') ) ){ | |
return $button; | |
} | |
return $content; | |
} | |
add_filter( 'wp_ulike_the_content', 'wp_ulike_custom_content_filter', 2, 10 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add custom id for elementor top posts widget query, and then put it in sample hook. e.g. | |
// "elementor/query/custom_query_id" | |
function wp_ulike_pro_add_custom_button_to_widget( $data, $widget ){ | |
add_filter( 'the_excerpt', function( $content ){ | |
return $content . do_shortcode('[wp_ulike]'); | |
}, 10 ); | |
} | |
add_action( "elementor/query/custom_query_id", 'wp_ulike_pro_add_custom_button_to_widget', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpulike_custom_activity_shortcode ( $atts ) { | |
global $wpdb; | |
if ( is_multisite() ) { | |
$bp_prefix = 'base_prefix'; | |
} else { | |
$bp_prefix = 'prefix'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_ulike_pro_custom_restrict_user( $args ){ | |
$settings_type = new wp_ulike_setting_type( $args['type'] ); | |
if( isset( $_COOKIE ) ){ | |
foreach( $_COOKIE as $key => $val ){ | |
if( strpos( $key, $settings_type->getCookieName() ) !== false) { | |
throw new \Exception( WP_Ulike_Pro_Options::getNoticeMessage( 'invalid_permission', 'sample permission message' ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_ulike_pro_custom_stop_listener( $id, $type ){ | |
$categories = get_the_terms( $id, 'category' ); | |
$terms_array = wp_list_pluck($categories, 'slug'); | |
$current_user = get_current_user_id(); | |
if( ! $current_user ){ | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_ulike_pro_custom_stop_listener(){ | |
date_default_timezone_set('Europe/Berlin'); | |
$current_time = date("h:i a"); | |
$begin = "09:00 am"; | |
$end = "11:00 pm"; | |
$date1 = DateTime::createFromFormat('H:i a', $current_time); | |
$date2 = DateTime::createFromFormat('H:i a', $begin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_ulike_pro_activity_comment_filter( $content, $wp_ulike_query, $query_args ){ | |
global $wpdb; | |
if ( is_multisite() ) { | |
$bp_prefix = 'base_prefix'; | |
} else { | |
$bp_prefix = 'prefix'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//show it on single media page | |
add_action( 'mpp_media_meta', 'mpp_wpulike_show_button' ); | |
//show it in lightbox | |
add_action( 'mpp_lightbox_media_meta', 'mpp_wpulike_show_button' ); | |
function mpp_wpulike_show_button() { | |
echo wp_ulike('put'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_ulike_pro_custom_hreview( $content ){ | |
global $post; | |
if( is_singular() && 0 != ( $counter = wp_ulike_get_post_likes( $post->ID ) ) ){ | |
$content .= sprintf('<div style="display:none" class="hreview-aggregate"> | |
<div class=item> | |
<p class="fn">%s</p> | |
</div> |
NewerOlder