add_filter( /** * * Filter the decision to send a confirmation or not * * @param $bool * * @return bool overrides any logic if set to true, if set to false then standard rules apply */ ‘qem_registration_always_confirm’, function (…Continue reading
add_filter( /** * * Filter the message generated to email confirmation * * @param $message * @param $content * @param $details * @param $close * @param $id * @param $payment * * @return string output message for registration email */…Continue reading
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
function sbcustom_disable_firsttouch( $flags, $settings ) { $flags[] = ‘disableOnTouch’; return $flags; } add_filter( ‘sbi_flags’, ‘sbcustom_disable_firsttouch’, 10, 2 );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 removes some options for recurring donation periods with Charitable’s Recurring Donations addon. * This might reset or cause odd things to happen to campaigns who resave settings without updating the period if * they already selected…Continue reading
add_action(‘wp_body_open’, function() { echo ‘ ‘; }); add_action(‘wp_head’, function() { echo ‘ ‘; }); add_action(‘wp_footer’, function() { echo ‘‘; });Continue reading
$reading_speed = 200; // 200 words per minute $content = get_post_field( ‘post_content’, get_the_id() ); $word_count = str_word_count( strip_tags( $content ) ); $reading_time = ceil( $word_count / $reading_speed ); echo ‘ Estimated reading time: ‘ . absint( $reading_time ) . ‘…Continue reading
add_action( ‘admin_init’, function () { // Get all public post types $post_types = get_post_types( array(), ‘names’ ); function wpcode_add_post_id_column( $columns ) { $columns[‘wpcode_post_id’] = ‘ID’; // ‘ID’ is the column title return $columns; } function wpcode_show_post_id_column_data( $column, $post_id ) {…Continue reading