add_shortcode( ‘mpcs-course-progress’, function( $atts ) { if ( !isset( $atts[ ‘course_id’ ] ) ) return ”; $user_id = get_current_user_id(); if ( !$user_id ) return ”; $course_id = ( int ) $atts[ ‘course_id’ ]; if ( $course_id user_progress( $user_id ); //…Continue reading
//Claude – Generate Sitemap v1.0 add_action(‘admin_menu’, ‘add_sitemap_generator_menu’); function add_sitemap_generator_menu() { add_menu_page( ‘Sitemap Generator’, ‘Sitemap Generator’, ‘manage_options’, ‘csv-sitemap-generator’, ‘csv_sitemap_generator_page’, ‘dashicons-networking’ ); } function write_log($message) { $timestamp = date(‘Y-m-d H:i:s’); $log_entry = “[$timestamp] $message\n”; file_put_contents(WP_CONTENT_DIR . ‘/sitemap-logs.txt’, $log_entry, FILE_APPEND); } function generate_sitemap_file($urls,…Continue reading
add_filter( ‘widget_text’, ‘do_shortcode’ );Continue reading
// Hook into the WordPress login process add_action(‘wp_login’, ‘send_otp_to_admin’, 10, 2); function send_otp_to_admin($user_login, $user) { // Check if the user is an administrator if (in_array(‘administrator’, $user->roles)) { // Generate a random 6-digit OTP $otp = wp_rand(100000, 999999); // Store the…Continue reading
/** * URL Handler for Location Pages * Works with any page path: /any/path/state/city/ */ // Map state full names to abbreviations function cd_get_state_abbreviations_42o3ugu5() { return [ ‘alabama’ => ‘AL’, ‘alaska’ => ‘AK’, ‘arizona’ => ‘AZ’, ‘arkansas’ => ‘AR’, ‘california’…Continue reading
/* Envira – White label * * @link https://enviragallery.com/docs/white-label-envira/ */ add_filter( ‘envira_whitelabel’, ‘__return_true’ ); if ( apply_filters(‘envira_whitelabel’, false ) ): add_filter( ‘envira_whitelabel_name’, ‘example_envira_whitelabel_name’ ); add_filter( ‘envira_whitelabel_name_singular’, ‘example_envira_whitelabel_name’ ); add_filter( ‘envira_whitelabel_name_plural’, ‘example_envira_whitelabel_name_plural’ ); function example_envira_whitelabel_name() { //Custom text for replacing Envira…Continue reading
add_filter(‘frm_setup_new_fields_vars’, ‘frm_remove_selected’, 20, 2); function frm_remove_selected($values, $field){ if ( in_array( $field->id, array(1118) ) ) { $used = FrmEntryMeta::get_entry_metas_for_field( $field->id ); if ( $used ) { $used_vals = array(); foreach ( $used as $u ) { if ( is_array( $u )…Continue reading
function g9_woo_selectbox() { $per_page = filter_input(INPUT_GET, ‘perpage’, FILTER_SANITIZE_NUMBER_INT); echo ‘ ‘; echo ‘‘; $orderby_options = array( ’12’ => ’12 Items’, ’24’ => ’24 Items’, ’48’ => ’48 Items’, ’96’ => ’96 Items’ ); $shop_page_url = get_permalink(wc_get_page_id(‘shop’)); foreach ($orderby_options as $value…Continue reading