// Add the new column to the orders page add_filter(‘manage_edit-shop_order_columns’, ‘display_courier_address_column’); // Display data in the new column add_action(‘manage_shop_order_posts_custom_column’, ‘display_courier_address_data’, 10, 2); function display_courier_address_column($columns) { // Add the new column with a proper name $columns[‘courier_address’] = ‘Courier Address’; return $columns;…Continue reading
add_action(‘woocommerce_subscription_status_active’, ‘send_admin_subscription_reactivated_email’, 10, 1); function send_admin_subscription_reactivated_email($subscription) { // Get the WooCommerce mailer $mailer = WC()->mailer(); // Get the email template content ob_start(); wc_get_template( ’emails/admin-subscription-reactivated.php’, // Your custom template file array( ‘subscription’ => $subscription, ’email_heading’ => ‘Subscription Reactivated’, ‘sent_to_admin’ => true,…Continue reading
/** * Function to track search engine bots and create admin page * v0.04 */ // Create database table when the snippet is activated function create_bot_tracker_table() { global $wpdb; $table_name = $wpdb->prefix . ‘bot_tracker’; $charset_collate = $wpdb->get_charset_collate(); $sql = “CREATE…Continue reading
// Description: This code defines two functions to fetch tool data from the database based on a provided CLP Tool Task ID (clp_tool_task_id). It retrieves the tool_no and name_of_the_tool from the clp_test_table. Designed for integration with FlowMattic workflows to enable…Continue reading
add_action(‘mepr-event-subscription-stopped’, function($event) { $subscription = $event->get_data(); $user = $subscription->user(); $wp_user = get_user_by(‘id’, $user->ID); if(!$wp_user) { return; } // Remove role $wp_user->remove_role( ‘subscriber’ ); // Add role $wp_user->add_role( ‘editor’ ); });Continue reading
// allow Editors to access Memberpress function add_memberpress(){ $role = get_role(‘editor’); $role->add_cap(‘remove_users’); } add_action(‘admin_init’,’add_memberpress’);Continue reading
function mpimp_load_expanded_coupon_importer() { global $mpimp; $mpimp->importers[‘couponaffiliate’] = ‘MpimpExtendedCouponsImporter’; } add_action(‘admin_init’, ‘mpimp_load_expanded_coupon_importer’, 110); //has to be after the MP hook function runs class MpimpExtendedCouponsImporter extends MpimpCouponsImporter { public function form() { } public function import($row,$args) { $ea_active = is_plugin_active(‘easy-affiliate/easy-affiliate.php’) ? true…Continue reading
function mepr_newuser_approve_override($user_id) { // Define an array of membership IDs for which the verification step should be skipped. $auto_approve = array(123, 456, 789); if(!class_exists(‘MeprOptions’)) { return; } if(!isset($_POST[‘mepr_product_id’]) && !isset($_POST[‘manage_sub_accounts_form’])) { return $user_id; } $product_id = isset($_POST[‘mepr_product_id’])?$_POST[‘mepr_product_id’]:false; if(isset($_POST[‘manage_sub_accounts_form’]) || ($product_id…Continue reading
add_shortcode( ‘mpcs_user_courses_progress’, function() { $user_id = get_current_user_id(); $courses = get_posts(array( ‘posts_per_page’ => -1, ‘post_type’ => ‘mpcs-course’ )); ob_start(); echo ‘ ‘; foreach ( $courses as $course ) { $course = new memberpress\courses\models\Course($course->ID); $progress = $course->user_progress($user_id); if ( $progress < 100…Continue reading
add_filter( ‘jetpack_remove_login_form’, ‘__return_true’ );Continue reading