add_filter( ‘body_class’, function( $classes ) { global $post; if ( is_singular() && isset( $post->post_name ) ) { $classes[] = $post->post_type . ‘-‘ . sanitize_html_class( $post->post_name ); } return $classes; });Continue reading
// Author: Sumaiya, Clickup Doc: https://app.clickup.com/36636088/v/dc/12y1dr-22535/12y1dr-24495 // Add action for fetching tool data add_action(‘wp_ajax_fetch_tool_data_unique’, ‘fetch_tool_data_customized’); add_action(‘wp_ajax_nopriv_fetch_tool_data_unique’, ‘fetch_tool_data_customized’); // For non-logged in users if (!function_exists(‘fetch_tool_data_by_task_id_unique’)) { function fetch_tool_data_by_task_id_unique($task_id) { global $wpdb; $task_id = sanitize_text_field($task_id); $table_name = ‘sumaiya_test_table’; // Table name without…Continue reading
/** * 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
add_action(‘wp_head’, ‘output_auth0_user_id_meta’); function output_auth0_user_id_meta() { $script = ““; echo $script; }Continue reading
add_action(‘admin_menu’, ‘register_support_tickets_page’); function register_support_tickets_page() { add_menu_page( ‘Support Tickets’, // Page title (appears in tag) ‘Support Tickets’, // Menu title (appears in the sidebar) ‘edit_posts’, // Capability required to access ‘support-tickets’, // Menu slug (used in URL) ‘support_tickets_page_html’,// Callback function to…Continue reading
add_action(‘wp_dashboard_setup’, function() { wp_add_dashboard_widget( ‘custom_widget_welcome’, ‘Welcome’, ‘custom_dashboard_widget_welcome_display’ ); }); function custom_dashboard_widget_welcome_display() { $current_user = wp_get_current_user(); $display_name = esc_html($current_user->display_name); // EDIT SITE SPECIFIC DETAILS BELOW echo ‘ ‘; echo ‘ Hi ‘ . $display_name . ‘ 👋 ‘; echo ‘ Here…Continue reading
// Restrict access to Docs page function restrict_page_to_logged_in_users() { // EDIT SITE SPECIFIC PAGE ID HERE $restricted_page_id = 390; // Check if the current page is the restricted page and if the user is not logged in if (is_page($restricted_page_id) &&…Continue reading