Skip to content

Instantly share code, notes, and snippets.

View Alimir's full-sized avatar
👀
looking for purest...

Ali Mirzaei Alimir

👀
looking for purest...
View GitHub Profile
@Alimir
Alimir / wp-ulike-pro.php
Last active September 18, 2025 14:00
WP ULike Pro: Examples of wp_ulike_pro_get_posts_query() with Period Filters
<?php
/**
* WP ULike Pro - Sample Usage of wp_ulike_pro_get_posts_query()
*
* This file contains examples of how to use the `wp_ulike_pro_get_posts_query()` function
* to retrieve posts with various filters.
*
* Available parameters:
*
* - type : (string) 'post' or 'topic'. Determines the main type of content to fetch.
@Alimir
Alimir / wp-ulike.php
Created August 25, 2025 11:26
How to Prevent Plugin Script Conflicts on the WP ULike Statistics Page
<?php
/**
* Remove specific plugin scripts from WP ULike admin pages.
*
* @param string $hook The current admin page hook.
*/
add_action( 'admin_enqueue_scripts', function ( $hook ) {
// Only run on WP ULike admin pages
if ( strpos( $hook, 'wp-ulike' ) === false ) {
return;
@Alimir
Alimir / wp-ulike.php
Created January 13, 2025 12:49
Disable the process that purges third-party plugin cache after user interactions
<?php
remove_action( 'wp_ulike_after_process', 'wp_ulike_purge_cache', 10 );
@Alimir
Alimir / custom.css
Created January 6, 2025 15:01
Sample voting template (only for pro version)
.wpulike-updown-voting .wpulike_total_vote .wp_ulike_btn_down.wp_ulike_put_image:after {
transform: translateX(-50%) translateY(-50%) scaleY(-1);
}
@Alimir
Alimir / wp-ulike-pro.php
Created July 18, 2024 08:54
How to add change password field to edit account form?
<?php
/**
* Add new fields to account form
*
* @param string $type
* @param array $args
* @return void
*/
function wp_ulike_pro_customize_account_form( $type, $args ){
if( $type === 'profile' ){
@Alimir
Alimir / wp-ulike.php
Created June 1, 2023 15:31
Disable statistics & vote logs in wp ulike
<?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'] ) ){
@Alimir
Alimir / wp-ulike-pro.php
Last active April 3, 2023 13:15
Make user pinned posts query type for Bricks builder
<?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;
@Alimir
Alimir / wp-ulike-pro.php
Created March 15, 2023 07:34
Add upload avatar field on account form
<?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' ):
@Alimir
Alimir / wp-ulike.php
Created February 9, 2023 12:08
wp ulike shortcode to get stats values
<?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' );
@Alimir
Alimir / wp-ulike.php
Created September 27, 2022 08:17
Fix compatibility problem with the 'Simple Custom CSS and JS' plugin
<?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;