Type: php
Add dynamic copyright year (center) to footer
// This will output “Copyright © 2024” (or the current year) in the footer automatically. $copyright = “Copyright © ” ; $current_year = date( ‘Y’ ) ; $copyright_year = $copyright . $current_year ; // Add CSS classes for styling. For…Continue reading
Add dynamic copyright year
// This will output “Copyright © 2024.” or the current year automatically. $copyright = “Copyright © ” ; $current_year = date( ‘Y’ ) ; $copyright_year = ‘‘ . $copyright . $current_year . ‘.‘ ; echo $copyright_year; // Style in CSS…Continue reading
Replace [year] with the current year
// This will replace “[year]” with the current year automatically. $this_year = “[year]”; echo str_replace(“[year]”, date( ‘Y’ ), $this_year);Continue reading
Track Button and Link Clicks as Google Analytics Events
function track_click_events() { ?>Continue reading
MemberPress: New and Improved Remove State From Registration (For countries that don’t have a drop down)
function mepr_remove_state_field() { global $post; $mepr_options = MeprOptions::fetch(); $is_product_page = ( false !== ( $prd = MeprProduct::is_product_page( $post ) ) ); if( $mepr_options->global_styles || $is_product_page ) { ?>Continue reading
MemberPress: Change Membership Registration URL
function mepr_change_membership_urls( $url, $product, $args, $modify_if_https ) { $url_changed = false; switch( $product->ID ) { case ‘123’: //Change 123 to membership id where you can get it from ID column from Membership table $url = MeprUtils::get_permalink( 456 ).$args; //Change 456…Continue reading
MemberPress: Add/Override State Drop Down Values
function mepr_change_state_dropdown_values ( $states ) { $sfiles = @glob( WP_PLUGIN_DIR . ‘/mepr-i18n/states/[A-Z][A-Z].php’, GLOB_NOSORT ); foreach( $sfiles as $sfile ) { require( $sfile ); } return $states; } add_filter( ‘mepr_states’, ‘mepr_change_state_dropdown_values’ );Continue reading
MemberPress: Auto-populate coupon on all registration forms
function mepr_auto_populate_coupon() { ?>Continue reading
MemberPress: Auto Expand Coupon Field
function auto_click_have_coupon_link() { ?>Continue reading