Set a Minimum Word Count for Posts (copy)

/** * Prevent publishing posts under a minimum number of words. * * @param int $post_id The id of the post. * @param WP_Post $post The post object. * * @return void */ function wpcode_snippet_publish_min_words( $post_id, $post ) { //…Continue reading

WP · Disable Author Pages

if ( ! function_exists(‘mx_custom_disable_author_page’)) { function mx_custom_disable_author_page() { global $wp_query; if (is_author()) { wp_redirect(get_option(‘home’), 302); exit; } } add_action(‘template_redirect’, ‘mx_custom_disable_author_page’); }Continue reading

dynamic temp directory

add_filter(‘dynamic_ooo_mpdf_args’, function($args) { // Set your custom path here $args[‘tempDir’] = WP_CONTENT_DIR . ‘/var/www/vhosts-ebs/tmp’; return $args; });Continue reading

Completely Disable Comments (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

SPDL – Speedy Atelier Registre Broches

/** * Snippet: SPDL – Speedy Atelier Registre Broches * * Version: V3-I * * Correction V3-I: * – utilise le vrai picto fourni sur WordPress: /wp-content/uploads/2026/06/Design-sans-titre-2-scaled.png * – le picto est rendu en canvas noir/blanc, sans texte SPDL, à…Continue reading

Exclude Common Inline Scripts from SiteGround Speed Optimizer JavaScript File Combination

add_filter( ‘sgo_javascript_combine_excluded_inline_content’, ‘js_combine_exclude_inline_script’ ); function js_combine_exclude_inline_script( $exclude_list ) { $exclude_list[] = ‘window.OneSignalDeferred = window.OneSignalDeferred’; $exclude_list[] = ‘fbq(‘; $exclude_list[] = ‘document.currentScript?.remove’; // Part of Formidable Honeypot $exclude_list[] = “const style = document.createElement( ‘style’ )”; // Part of Formidable Honeypot return $exclude_list;…Continue reading

Get rid of Home

add_filter(‘pre_get_document_title’, function($title) { if (is_front_page()) return ‘Brooklyn Insurance Agency | Max J. Pollack & Sons’; return $title; });Continue reading

Gravity Forms Hook — BOL Upload Triggers Capture

add_action( ‘gform_after_submission_5’, ‘wcv_dynamic_bol_capture’, 10, 2 ); function wcv_dynamic_bol_capture( $entry, $form ) { $order_id = null; $bol_file_url = null; foreach ( $form[‘fields’] as $field ) { $label = strtolower( trim( $field->adminLabel ?: $field->label ) ); if ( in_array( $label, array( ‘order…Continue reading

Smart convert images to webp (copy)

function convert_to_webp($file) { $file_path = $file[‘file’]; $file_type = $file[‘type’]; // Only for JPEG, PNG, and GIF images if (in_array($file_type, [‘image/jpeg’, ‘image/png’, ‘image/gif’, ‘image/jpg’])) { $webp_path = preg_replace(‘/.(jpe?g|png|gif)$/i’, ‘.webp’, $file_path); // Check if the GD library is available if (!function_exists(‘gd_info’)) {…Continue reading