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

Disable the “grab image” setting for Divi on checkout

add_filter( ‘et_grab_image_setting’, ‘prefix_disable_image_setting_on_checkout’, 100 ); /** * Disable the Divi image setting on checkout. * * @param bool $setting * @return bool */ function prefix_disable_image_setting_on_checkout( $setting ) { return edd_is_checkout() ? false : $setting; }Continue reading

BBPress: Display Forum Link + Recent Topics on Single Post

add_shortcode(‘category_forum_link’, ‘category_forum_link_output’); function category_forum_link_output() { if (!is_single()) return ”; $categories = get_the_category(); if (empty($categories)) return ”; $output = ”; foreach ($categories as $cat) { $forum = get_page_by_title($cat->name, OBJECT, ‘forum’); if ($forum) { $output .= ‘ ‘; $output .= ‘ Join…Continue reading

Organization Function Relation

add_action(‘pmxi_saved_post’, function($post_id, $xml, $import_id) { $external_ids_raw = get_post_meta($post_id, ‘_external_org_id’, true); if (empty($external_ids_raw)) return; // Normalize input if (is_string($external_ids_raw)) { if (strpos($external_ids_raw, ‘[‘) !== false) { $external_ids = json_decode($external_ids_raw, true); } else { $external_ids = explode(‘,’, $external_ids_raw); } } else {…Continue reading

Show Posts Related to Organizations

function show_related_posts_to_org_shortcode($atts) { global $post; if (!$post || get_post_type($post->ID) !== ‘organization’) { return ‘ ⚠ Not an organization post. ‘; } $org_id = $post->ID; // Allow filtering by post type — default to ‘post’ $atts = shortcode_atts([ ‘post_type’ => ‘post’,…Continue reading

data tables enqueue

function enqueue_datatables_assets() { wp_enqueue_style(‘datatables-css’, ‘https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css’); wp_enqueue_script(‘datatables-js’, ‘https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js’, [‘jquery’], null, true); } add_action(‘wp_enqueue_scripts’, ‘enqueue_datatables_assets’);Continue reading