// 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
add_action(‘wp_footer’, ‘open_external_links_in_new_tab’); function open_external_links_in_new_tab() { ?>Continue reading
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
function mepr_capture_stopped_sub( $event ) { global $wpdb; $subscription = $event->get_data(); $wpdb->update( $wpdb->prefix.’mepr_transactions’, array( “expires_at” => “2024-01-01 23:59:59” ), array( “subscription_id” => $subscription->id, “status” => “complete” ) ); } add_action( ‘mepr-event-subscription-stopped’, ‘mepr_capture_stopped_sub’ );Continue reading
function memberpress_account_subs_display( $atts, $content=” ) { if( !class_exists( ‘MeprAccountCtrl’ ) ) { return; } ob_start(); $acct_ctrl = new MeprAccountCtrl(); $action = ( isset($_REQUEST[ ‘action’ ] ) )?$_REQUEST[ ‘action’ ]:false; switch( $action ) { case ‘cancel’: $acct_ctrl->cancel(); break; case ‘suspend’: $acct_ctrl->suspend();…Continue reading