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 | |
function wp_ulike_pro_custom_after_signup_process( &$args ){ | |
// Get current user id | |
$meta_args = array(); | |
$meta_args['phone'] = ! empty( $_POST['phone'] ) ? $_POST['phone'] : null; | |
$meta_args['user-role'] = ! empty( $_POST['user-role'] ) ? array( $_POST['user-role'] ) : null; | |
foreach ($meta_args as $key => $value) { | |
update_user_meta( $args->data['user_id'], $key, $value ); |
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 | |
/** | |
* Add new fields to account form | |
* | |
* @param string $type | |
* @param array $args | |
* @return void | |
*/ | |
function wp_ulike_pro_customize_account_form( $type, $args ){ |
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 | |
/** | |
* 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 | |
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 | |
add_action( 'elementor/query/order_by_like_amount', function( $query ) { | |
// Get current meta Query | |
$meta_query = $query->get( 'meta_query' ); | |
// If there is no meta query when this filter runs, it should be initialized as an empty array. | |
if ( ! $meta_query ) { | |
$meta_query = []; | |
} |
NewerOlder