Rename Posts to Policies

add_action( ‘init’, ‘cp_change_post_object’ ); // Change dashboard Posts to Policies function cp_change_post_object() { $get_post_type = get_post_type_object(‘post’); $labels = $get_post_type->labels; $labels->name = ‘Policies’; $labels->singular_name = ‘Policy’; $labels->add_new = ‘Add Policy’; $labels->add_new_item = ‘Add Policy’; $labels->edit_item = ‘Edit Policy’; $labels->new_item = ‘Policies’;…Continue reading

Send Values in WP Forms Webhook

/** * Send field values in Dropdown, checkboxes, and Multiple Choice through webhook. * * @link https://wpforms.com/developers/how-to-send-field-values-with-webhooks/ */ function wpf_dev_webhooks_process_delivery_request_options($options, $webhook_data, $fields, $form_data, $entry_id) { //Run on all form IDs if ( empty( $form_data[ ‘id’ ] )) { return $options;…Continue reading

Cornerstone & Perfmatters fix

add_filter( ‘x_enqueue_parent_stylesheet’, ‘__return_true’ ); /* Perfmatters Cornerstone fix */ if(strpos($_SERVER[‘REQUEST_URI’], ‘/cornerstone/’) || isset($_POST[‘cs_preview_state’])) { add_filter(‘perfmatters_allow_buffer’, ‘__return_false’); }Continue reading

Completely Disable Comments

// Disable comments on admin init add_action(‘admin_init’, function () { global $pagenow; // Redirect any user trying to access comments page 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…Continue reading

Disable Automatic Updates Emails

// Disable auto-update emails. add_filter( ‘auto_core_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for plugins. add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for themes. add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ );Continue reading

Category Fallback Image

/** * Plugin Name: Category Thumbnail Fallback * Description: Use the category image as fallback when the post does not have a featured image */ class WPBCategoryThumbnailFallback { protected static $taxonomies = [‘category’]; protected $nonceId = ‘wpb_category_thumb_fallback_none’; protected $fieldId =…Continue reading

Override Block Editor Palette Colors

add_filter( ‘wp_theme_json_data_theme’, function ( $theme_json ) { $new_data = array( ‘settings’ => array( ‘color’ => array( ‘palette’ => array( // Replace with your desired colors. array( ‘slug’ => ‘white’, ‘color’ => ‘#ffffff’, ‘name’ => ‘White’, ), array( ‘slug’ => ‘black’,…Continue reading

Reorder Admin Menu Items

add_filter( ‘custom_menu_order’, ‘__return_true’ ); // This will move the WPCode menu under the Dashboard menu item. // Uncomment and add more items as needed. add_filter( ‘menu_order’, function () { return array( ‘index.php’, ‘wpcode’, // ‘edit.php’, // Posts // ‘upload.php’, //…Continue reading