This file contains hidden or 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 | |
/** | |
* 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. |
This file contains hidden or 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 | |
/** | |
* 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; |
This file contains hidden or 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 | |
remove_action( 'wp_ulike_after_process', 'wp_ulike_purge_cache', 10 ); |
This file contains hidden or 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
.wpulike-updown-voting .wpulike_total_vote .wp_ulike_btn_down.wp_ulike_put_image:after { | |
transform: translateX(-50%) translateY(-50%) scaleY(-1); | |
} |
This file contains hidden or 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 ){ | |
if( $type === 'profile' ){ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; |
NewerOlder