Add Featured Images to RSS Feeds

/** * Add the post thumbnail, if available, before the content in feeds. * * @param string $content The post content. * * @return string */ function wpcode_snippet_rss_post_thumbnail( $content ) { global $post; if ( has_post_thumbnail( $post->ID ) ) {…Continue reading

Allow SVG Files Upload

/** * 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

Full

import { useState } from ‘react’ import { Heart, Users, Play, Home, Search, User, Bell, ArrowRight, X } from ‘lucide-react’ import { Button } from “/components/ui/button” import { Card, CardContent, CardHeader, CardTitle, CardDescription } from “/components/ui/card” import { Input }…Continue reading

TEMPLATE Admin – Support Ticket Page

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

TEMPLATE Admin – Dashboard Welcome Widget

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

TEMPLATE Admin – Restrict Access to Docs

// 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

Admin – Docs Menu Item

// Add Menu Link add_action(‘admin_menu’, ‘add_docs_link’); function add_docs_link() { add_menu_page( ‘Documentation’, // Page title (not used, but required) ‘Documentation’, // Menu title (shows in admin sidebar) ‘edit_posts’, // Capability required ‘docs-redirect’, // Unique slug ‘redirect_to_docs’, // Callback function ‘dashicons-editor-ul’,// Optional…Continue reading