Display WPForm Entries

/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading

Shortcode to get all taxonomy values of current post

function display_post_artists_shortcode() { // Get the terms (artists) of the “artist” taxonomy for the current post $artists = get_the_terms(get_the_ID(), ‘artist’); // Check if artists exist if ($artists && !is_wp_error($artists)) { // Start building the output $output = []; // Loop…Continue reading

ai content idea generator

function openai_generate_text() { // Get the topic from the AJAX request $prompt = $_POST[‘prompt’]; $prompt =”generate 10 content ideas about ” . $topic; // OpenAI API URL and key $api_url = ‘https://api.openai.com/v1/chat/completions’; $api_key = ‘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’ ; // Replace with your…Continue reading

Remove hyperlink from name field

add_filter(‘preprocess_comment’, ‘remove_links_from_comment_author’); function remove_links_from_comment_author($commentdata) { // Regular expression to detect hyperlinks $pattern = ‘/Continue reading