Redirect Member Pages
add_action(‘template_redirect’, function () { if (preg_match(‘#^/members/(.+)#’, $_SERVER[‘REQUEST_URI’], $matches)) { wp_redirect(home_url(‘/’ . $matches[1]), 301); exit; } });Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action(‘template_redirect’, function () { if (preg_match(‘#^/members/(.+)#’, $_SERVER[‘REQUEST_URI’], $matches)) { wp_redirect(home_url(‘/’ . $matches[1]), 301); exit; } });Continue reading
/** * ============================================================================ * FINAL WORDPRESS MULTI-PURPOSE “UPSERT” FUNCTION * ============================================================================ * @author Sumaiya Akter, Anytype Doc: anytype://object?objectId=bafyreib7wbeew4uvzm63ust7r74hthzduantjvxkwfuv5ahdxltgr4mdae&spaceId=bafyreih4bocrmskuomcrks3sjwpnzxpbxvxwgto23vof3umg2fywdqzjmy.31bq39w6q8ru7&cid=bafybeifc55atash7zlqcjd3fv425bkwl7z5zstcxdilct5hstlng73xwci&key=6kKA3QiwnksqLbpcJ4T6UhmQ5BHzgJUfbpn1QLnkv5Lv * @description This function provides a dynamic “upsert” (update or insert) * capability for any WordPress database table. It is designed to…Continue reading
/** * ============================================================================ * FINAL WORDPRESS “GET TABLE COLUMNS” FUNCTION * ============================================================================ * @author Sumaiya Akter , Anytype Doc: anytype://object?objectId=bafyreifgnp2yabaq4bplkou3hxpipm4tffljxcgcckglea36rlkk22daae&spaceId=bafyreih4bocrmskuomcrks3sjwpnzxpbxvxwgto23vof3umg2fywdqzjmy.31bq39w6q8ru7&cid=bafybeifc55atash7zlqcjd3fv425bkwl7z5zstcxdilct5hstlng73xwci&key=6kKA3QiwnksqLbpcJ4T6UhmQ5BHzgJUfbpn1QLnkv5Lv * @description This function dynamically retrieves all column names from any * specified WordPress database table. It is designed to…Continue reading
/** * ============================================================================ * WORDPRESS DYNAMIC DATA FETCHING FUNCTION * ============================================================================ * @author Sumaiya Akter, Anytype Doc: anytype://object?objectId=bafyreidvxgrkcebamky2hxzxazxbe3phrie6ev44zyhjzco7cmhkgovhle&spaceId=bafyreih4bocrmskuomcrks3sjwpnzxpbxvxwgto23vof3umg2fywdqzjmy.31bq39w6q8ru7&cid=bafybeifc55atash7zlqcjd3fv425bkwl7z5zstcxdilct5hstlng73xwci&key=6kKA3QiwnksqLbpcJ4T6UhmQ5BHzgJUfbpn1QLnkv5Lv * @description This function dynamically fetches data from any specified * WordPress database table based on a set of search criteria. It…Continue reading
function rudr_taxonomy_filter( $post_type ){ // let’s decide about post type first if( ‘unifi-custom-menu’ !== $post_type ){ return; } // pass multiple taxonomies as an array of their slugs $taxonomies = array( ‘un-menu-cat’ ); // for every taxonomy we are going…Continue reading
function rd__current_user() { static $u = null; if ($u !== null) { return $u; } $u = wp_get_current_user(); // Core: sets current user if not already set. return $u; } /** [user_first_name] */ function rd_sc_user_first_name() { static $first = null;…Continue reading
/** * ============================================================================ * FINAL MULTI-PURPOSE “UPSERT” FUNCTION (V4 – Renamed Key) * ============================================================================ * This version includes ‘data_status’, always returns the record’s ID, and * includes the submitted data under the key ‘upsert’ in the response. * * FUNCTION…Continue reading
/** * ============================================================================ * SECURE & FINAL SCRIPT FOR FLUENT FORM AUTOFILL (GROUNDHOGG WP DB VERSION) * ============================================================================ * @author Sumaiya Akter, Anytype Doc: anytype://object?objectId=bafyreigxqhjk7ppkjagyonytgieix5qxkkbhpmned743amh23csyrab6s4&spaceId=bafyreih4bocrmskuomcrks3sjwpnzxpbxvxwgto23vof3umg2fywdqzjmy.31bq39w6q8ru7&cid=bafybeifc55atash7zlqcjd3fv425bkwl7z5zstcxdilct5hstlng73xwci&key=6kKA3QiwnksqLbpcJ4T6UhmQ5BHzgJUfbpn1QLnkv5Lv * @description This PHP script works in conjunction with a JavaScript file to * securely…Continue reading
add_action( ‘wp_dashboard_setup’, function () { global $wp_meta_boxes; $wp_meta_boxes[‘dashboard’] = array(); remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); }, 1000 );Continue reading