// modify add to cart text on single add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘woo_custom_cart_button_text’ ); function woo_custom_cart_button_text( $text ) { if( has_term( ‘quote-only’, ‘product_cat’ ) ){ $text = __( ‘Build My Quote’, ‘your-plugin’ ); } return $text; } // modify add to cart…Continue reading
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
add_filter(‘preprocess_comment’, ‘remove_links_from_comment_author’); function remove_links_from_comment_author($commentdata) { // Regular expression to detect hyperlinks $pattern = ‘/Continue reading
/* ** This snippet controls who can access the WPcode plugin ** Added here to prevent people being able to bypass via WPCode SafeMode ** All other snippets are in the WPcode plugin */ add_filter( ‘map_meta_cap’, function ( $caps, $cap,…Continue reading
add_filter( ‘map_meta_cap’, function ( $caps, $cap, $user_id, $args ) { $blocked_users = array( 999 ); // Replace 999 with the id of the user you want to block or add more ids. $custom_capabilities = array( ‘wpcode_edit_php_snippets’, ‘wpcode_edit_html_snippets’, ‘wpcode_manage_conversion_pixels’, ‘wpcode_file_editor’, ‘wpcode_manage_settings’,…Continue reading
// adjust HTML template of emails function notification_template( $template ) { $siteurl = ‘https://aveni.ai’; $logourl = ‘https://aveni.ai/wp-content/themes/aveni/assets/img/aveni-logo-white.png’; $logoalt = ‘Aveni AI’; $email = ‘[email protected]’; $themecolor= ‘#1B223A’; $template = ‘ {subject} {message} Aveni AI – Cutting-edge speech analytics for regulated industries…Continue reading
add_action( ‘init’, function () { global $wcvendors_pro; $wcv_pro_vendor_controller = $wcvendors_pro->wcvendors_pro_vendor_controller; remove_action(‘woocommerce_product_meta_start’, array( $wcv_pro_vendor_controller, ‘product_ships_from’ ), 9); add_action(‘woocommerce_product_meta_end’, array( $wcv_pro_vendor_controller, ‘product_ships_from’ ), 9); }, 100 );Continue reading
function create_toc($html) { $toc = ”; if (is_single()) { if (!$html) return $html; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’)); libxml_clear_errors(); $toc = ‘ Navigation rapide ‘; $h2_status = 0; $h3_status = 0; $i = 1; foreach($dom->getElementsByTagName(‘*’) as $element)…Continue reading
function create_toc($html) { $toc = ”; if (is_single()) { if (!$html) return $html; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’)); libxml_clear_errors(); $toc = ‘ Navigation rapide ‘; $h2_status = 0; $h3_status = 0; $i = 1; foreach($dom->getElementsByTagName(‘*’) as $element)…Continue reading
add_filter( ‘login_errors’, function ( $error ) { // Edit the line below to customize the message. return ‘Something is wrong!’; } );Continue reading