Type: php
Allow SVG Files Upload
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
Fluent Community Branding to IKB
add_action(‘fluent_community/portal_head’, function() { ?>Continue reading
Disable Smooth Scrolling in Tasty Recipes
How to Conditionally Show the Next Button on a Specific Page
/** * Hide Next button on page 2 by default and show it once an option in a field (e.g. Multiple Choice) is selected. */ // Add CSS to hide the Next button on page 2. add_action( ‘wp_head’, function ()…Continue reading
Untitled Snippet
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
Paypalcheckout
PayPal JS SDK Standard IntegrationContinue reading