Archives: Snippets
MemberPress: Add a Shortcode To Display the Number of Total Downloads for All Files
add_shortcode( ‘mepr_display_total_downloads’, function() { global $wpdb; $downloads_old = $wpdb->get_var( “SELECT SUM(download_count) FROM {$wpdb->prefix}mpdl_file_downloads” ); $downloads_new = $wpdb->get_var( “SELECT count(*) FROM {$wpdb->prefix}mpdl_file_stats” ); $downloads_old = isset( $downloads_old ) && $downloads_old != null ? $downloads_old : 0; $downloads_new = isset( $downloads_new )…Continue reading
MemberPress: Add a Custom Field To Manage Sub Account Table
add_action( ‘mpca-sub-accounts-th’, function( $curr_user, $sub_accounts ) { ?>Continue reading
MemberPress: Add Address Column to Subscriptions Table
add_filter( ‘mepr_admin_subscriptions_cols’, function( $cols ) { $cols[‘col_address’] = __( ‘Address’, ‘memberpress’ ); return $cols; }); add_action( ‘mepr_admin_subscriptions_cell’, function( $column_name, $rec, $table, $attributes ) { if( $column_name === ‘col_address’ ) { $user = new MeprUser( ( int ) $rec->user_id ); $address_one…Continue reading
Untitled Snippet
How many people in session? 234567891011 ProceedContinue reading
Paypalcheckout- Avanzato
PayPal JS SDK Advanced Integration – Checkout Flow Billing Address Pay now with CardContinue reading
Paypalcheckout
PayPal JS SDK Standard IntegrationContinue reading
cookie consent script
Cookie Consent by Free Privacy Policy Generator Update cookies preferencesContinue reading
font awesome script for headers
Use a WooCommerce Product Attribute as the Brand in Product Schema
add_filter( ‘aioseo_schema_output’, ‘aioseo_filter_schema_output’ ); function aioseo_filter_schema_output( $graph ) { if ( ! function_exists( ‘is_product’ ) || ! is_product() ) { return $graph; } foreach ( $graph as &$item ) { if ( ‘Product’ !== $item[‘@type’] ) { continue; } if…Continue reading