Type: php
ABF Updated ChatBot
ABF Scholarly Funding ScoreApp
Ai historie bot
// Funksjon for å generere en historie basert på OpenAI GPT function generate_story_with_openai($input) { $api_key = ‘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’; // Bytt ut med din faktiske API-nøkkel $url = ‘https://api.openai.com/v1/completions’; $data = [ ‘model’ => ‘text-davinci-004’, // Bruk den GPT-modellen du har tilgang…Continue reading
Disables all outgoing emails in WordPress
/** * Plugin Name: Disable Outgoing Emails * Description: Disables all outgoing emails in WordPress * Version: 1.0 * Author: Tyler Hall */ add_action(‘phpmailer_init’, ‘custom_email_config’); function custom_email_config($phpmailer) { // Disable outgoing emails $phpmailer->ClearAllRecipients(); $phpmailer->ClearAttachments(); $phpmailer->ClearCustomHeaders(); $phpmailer->ClearReplyTos(); // Set the default…Continue reading
Disables all comment-related emails in WordPress
/** * Plugin Name: Disable Comment Emails * Description: Disables all comment-related emails in WordPress * Version: 1.0 * Author: Tyler Hall */ // Disable new comment notification emails to administrators add_filter(‘notify_post_author’, ‘__return_false’); // Disable email notifications for comment moderation…Continue reading
Open External Link in New Tab in WordPress
add_action(‘wp_footer’, ‘open_external_links_in_new_tab’); function open_external_links_in_new_tab() { ?>Continue reading
ACF Signature Field
class acf_field_signature extends acf_field { /* * __construct * * This function will setup the field type data * * @type function * @date 5/03/2014 * @since 5.0.0 * * @param n/a * @return n/a */ function __construct() { /*…Continue reading
All Pages to CSV
function export_urls_to_csv() { // Check if the user is logged in and is an admin if ( is_user_logged_in() && current_user_can( ‘administrator’ ) ) { $args = array( ‘post_type’ => ‘any’, ‘posts_per_page’ => -1, ‘post_status’ => ‘publish’, ); $query = new…Continue reading
MemberPress: Allow Users to Pause/Resume Subscriptions Only for Specific Memberships
function maybe_hide_pause_resume_links( $link, $sub ) { // Replace 123, 456 with the membership IDs which members can pause/resume subscriptions for. $products_to_allow = array( ‘123’, ‘456’ ); $product = $sub->product(); if( in_array( $product->ID, $products_to_allow ) ) { return $link; } else…Continue reading