Location: everywhere
Don’t stripe double quotes for outgoing Automator webhooks
add_filter( ‘automator_send_webhook_get_fields_should_strip_qoutes’, ‘__return_false’ );Continue reading
Disable Uncanny Automator Object Cache
add_filter( ‘automator_disable_object_cache’, ‘__return_true’, 99, 2 );Continue reading
Disable Comment Form Website URL
add_filter( ‘comment_form_default_fields’, function ($fields) { if ( isset( $fields[‘url’] ) ) { unset( $fields[‘url’] ); } return $fields; }, 150 );Continue reading
WPForms Revisions to Keep
/** * Form revision * @link https://wpforms.com/docs/how-to-use-form-revisions-in-wpforms/ */ add_filter( ‘wp_wpforms_revisions_to_keep’, function() { return -1; // -1 for unlimited, 0 to turn them off, >0 to set a specific limit } );Continue reading
Sort Events Category by Publish Date (Oldest First)
function sort_posts_by_category($query) { if ($query->is_main_query() && !is_admin()) { $oldest_first_categories = array(1483,1486,1485,1484,1482,1391); // Replace with the IDs of the categories where you want to display oldest posts first if (is_category($oldest_first_categories)) { // $query->set(‘order’, ‘ASC’); // $query->set(‘orderby’, ‘date’); $query->set( ‘meta_key’, ‘start-date’ );…Continue reading
Automatic CSS/JavaScript Cache Busting
/** * Replace the `ver` query arg with the file’s last modified timestamp * * @param string $src URL to a file * @return string Modified URL to a file */ function filter_cache_busting_file_src( $src = ” ) { global $wp_scripts;…Continue reading
Helper functions to make generating WordPress post type labels and taxonomy labels easier
/** * Simplify generating post type labels by only needing to enter a singular and plural verison * * @param string $singular The singular version of the post type label * @param string $plural The plural version of the post…Continue reading
PCC Selector
// https://staging-solaiscom.temp312.kinsta.cloud/product/lcs/ include constant(‘WP_PLUGIN_DIR’) . ‘/solais-pdf/fpdm/fpdm.php’; // Start the download function product_pdf_download_file() { if (isset($_GET[‘productpdf’]) && $_GET[‘productpdf’] = ‘download’) { $post_id = get_early_postid(); $product_sheet_url = get_product_sheet_url($post_id, true); $wp_content_dir = ‘/wp-content/’; if (!empty($product_sheet_url) && stripos($product_sheet_url, $wp_content_dir) !== false) { $pdf_template =…Continue reading
Remove Meta Description tag from specific posts
add_filter( ‘aioseo_description’, ‘aioseo_filter_description’ ); function aioseo_filter_description( $description ) { $exclude = [15,223]; if ( false !== in_array( get_the_ID(), $exclude ) ) { return ”; } return $description; }Continue reading