Simple Company Creation Trigger with Table Check

/** * Simple Company Creation Trigger with Table Check * * Description: Creates table if not exists and triggers Flowmattic only when table is created * Location: Run Everywhere */ // Hook into Groundhogg company creation add_action( ‘groundhogg/company/post_create’, function( $company_id,…Continue reading

Limit Revisions

/** * Limit WordPress revisions to 5 for all post types. */ add_filter(‘wp_revisions_to_keep’, function ($num, $post) { return 5; }, 10, 2);Continue reading

Flowmattic Company Creation Trigger

/** * WPCode Snippet: Flowmattic Company Creation Trigger * * Description: Triggers Flowmattic workflow when a new company is created in Groundhogg * Location: Run Everywhere * * This snippet hooks into Groundhogg company creation and sends all company data…Continue reading

Randomize posts order

function dd_random_posts($query, $args) { if (isset($args[‘module_id’]) && $args[‘module_id’] === ‘random-posts’) { $query->query_vars[‘orderby’] = ‘rand’; $query->query_vars[‘order’] = ‘ASC’; $query = new WP_Query( $query->query_vars ); } return $query; } add_filter(‘et_builder_blog_query’, ‘dd_random_posts’, 10, 2);Continue reading

Allow SVG Files Upload

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…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

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