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_remove_admin_menus( $submenus ){ | |
if( is_array( $submenus ) ){ | |
if( isset( $submenus['statistics'] ) ){ | |
unset($submenus['statistics']); | |
} | |
if( isset( $submenus['posts_logs'] ) ){ | |
unset($submenus['posts_logs']); | |
} | |
if( isset( $submenus['comments_logs'] ) ){ |
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 new query type control to query options */ | |
add_filter( 'bricks/setup/control_options', 'ulp_setup_query_controls'); | |
function ulp_setup_query_controls( $control_options ) { | |
/* Adding a new option in the dropdown */ | |
$control_options['queryTypes']['ulp_pinned_posts'] = esc_html__( 'WP ULike - User pinned posts' ); | |
return $control_options; |
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 upload avatar field on account form | |
* | |
* @param string $type | |
* @param array $args | |
* @return void | |
*/ | |
function wp_ulike_pro_custom_account_form( $type, $args ){ | |
if( $type == 'profile' ): |
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_stats_shortcode( $atts, $content = null ){ | |
// Default Args | |
$args = shortcode_atts( array( | |
"period" => 'all' // you can use all, today, yesterday values | |
), $atts ); | |
return wp_ulike_count_all_logs( $args['period'] ); | |
} | |
add_shortcode( 'wp_ulike_custom_stats', 'wp_ulike_custom_stats_shortcode' ); |
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_filter('ulf_enqueue_assets',function($enqueue){ | |
// Global object containing current admin page | |
global $pagenow; | |
if ( 'post.php' === $pagenow && isset($_GET['post']) && 'custom-css-js' === get_post_type( $_GET['post'] ) ){ | |
return false; | |
} | |
return $enqueue; |
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_filter( 'wp_ulike_permission_status', function( $status, $args , $settings ){ | |
$limit = 3; | |
if( $args['type'] == 'post' && ! empty( $args['current_status'] ) && strpos( $args['current_status'], 'un') === false ){ | |
global $wpdb; | |
$query = sprintf( " | |
SELECT COUNT(*) |
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 register_wp_ulike_block( $blocks ) { | |
$blocks['custom_field_image_block'] = [ | |
'name' => 'WP ULike Button', | |
'render_callback' => 'render_wp_ulike_block', | |
]; | |
return $blocks; |
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 | |
/** | |
* vote only for 1 post per day | |
*/ | |
add_filter( 'wp_ulike_permission_status', function( $status, $args , $settings ){ | |
if( $args['type'] == 'post' && ! empty( $args['current_status'] ) && strpos( $args['current_status'], 'un') === false ){ | |
// if cookie has been set | |
if( isset( $_COOKIE['wphs'] ) && $args['item_id'] != $_COOKIE['wphs'] ){ | |
return false; |
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 | |
/** | |
* Custom wp foro likers template | |
* | |
* @param string $template | |
* @param array $users_list | |
* @return string|null | |
*/ | |
function wp_ulike_custom_likers_template_for_wpforo( $template, $users_list ){ |
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_action( 'init', function(){ | |
remove_action( 'bp_activity_filter_options', 'wp_ulike_bp_activity_filter_options', 20 ); // Activity Directory | |
remove_action( 'bp_member_activity_filter_options', 'wp_ulike_bp_activity_filter_options', 20 ); // Member's profile activity | |
remove_action( 'bp_group_activity_filter_options', 'wp_ulike_bp_activity_filter_options', 20 ); // Group's activity | |
}, 10 ); |
NewerOlder