MFP > get_email_data_from_options($key, $type)

function get_email_data_from_options($key, $type) { $values = array(); if (have_rows($key, ‘option’)) while (have_rows($key, ‘option’)) : the_row(); if (get_sub_field(‘type’) == $type) { $values[‘from_email’] = get_sub_field(‘from_email’); $values[‘from_name’] = get_sub_field(‘from_name’); $values[‘subject’] = strip_tags(apply_filters(‘the_content’, get_sub_field(‘subject’))); // $values[‘message’] = apply_filters(‘the_content’, get_sub_field(‘message’)); $values[‘message’] = get_sub_field(‘message’); add_filter(‘wp_mail_from’, function…Continue reading

Duplicate Post/Page Link

// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading

Vendor Claims Management Admin Pages

/** * Snippet Name: Vendor Claims Management Admin Pages * Description: Adds an admin menu for managing vendor claims, including pending, approved, and denied claims. // Key Objectives: * 1. Add “Vendor Claims” Admin Page and Subpages: * * –…Continue reading

Remove Gutenberg Block Comments on Post Save

/** * This snippet removes Gutenberg block comments from post content when saving posts from the WordPress admin. * It targets specific post types (‘vendor’ and ‘venue’) and ensures the comments are not saved in the database. * This prevents…Continue reading

S7 – Set all posts to full width in Divi settings

function custom_divi_layout_replacer_menu() { add_menu_page( ‘Divi Layout Replacer’, ‘Divi Layout Replacer’, ‘manage_options’, ‘divi-layout-replacer’, ‘custom_divi_layout_replacer_page’, ‘dashicons-editor-table’, 20 ); } add_action(‘admin_menu’, ‘custom_divi_layout_replacer_menu’); function custom_divi_layout_replacer_page() { global $wpdb; ?> Divi Layout Replacer This tool allows you to search for posts with a specific layout…Continue reading

Hide Elementor AI Image

/* * Hide Elementor image optimization ads when choosing the post’s featured image on the backend * UPDATE: 20/06/24 Hide Elementor image optimization ads on Media Library, if closing the “x” is not enough. */ function hide_elementor_nag_admin() { ?>Continue reading

Hide Elementor Update Notifications

/** * Disable Elementor’s post-update notifications */ function disable_elementor_update_notification() { if (class_exists(‘\Elementor\Core\Admin\Admin_Notices’)) { // Remove upgrade completion notice remove_action(‘admin_notices’, [\Elementor\Core\Admin\Admin_Notices::class, ‘admin_notice_upgrade_completion’]); // Remove update success notice add_action(‘admin_init’, function() { if (isset($_GET[‘action’]) && $_GET[‘action’] === ‘upgrade-plugin’ && isset($_GET[‘plugin’]) && strpos($_GET[‘plugin’], ‘elementor’)…Continue reading

Hide Elementor AI Nag

/* * Loads on Elementor’s frontend editor * Added by kishorchand * Use child theme’s function.php or code snippets plugin for better code management. */ function remove_elementor_nag() { ?>Continue reading

Hide Elementor AI Image

/* * Hide Elementor image optimization ads when choosing the post’s featured image on the backend * UPDATE: 20/06/24 Hide Elementor image optimization ads on Media Library, if closing the “x” is not enough. */ function hide_elementor_nag_admin() { ?>Continue reading