// Gravity Forms hook for form 5 (vendor) add_action(‘gform_after_submission_5’, function ($entry, $form) { $post_id = rgar($entry, ‘1’); if (!$post_id || get_post_type($post_id) !== ‘vendor’) return; // Check if the required meta fields exist if (!get_post_meta($post_id, ‘target_market_1_city’, true)) return; // Update taxonomy…Continue reading
function preload_first_content_image() { if (is_single()) { $post = get_post(); if ($post) { // Get post content $content = $post->post_content; // Find first image in the content preg_match_all(‘//i’, $content, $matches); if (!empty($matches[1])) { $first_image = $matches[1][0]; echo ‘‘; } } }…Continue reading
function wpb_set_post_views($postID) { $count_key = ‘wpb_post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, ‘0’); }else{ $count++; update_post_meta($postID, $count_key, $count); } } //Get rid of prefetching to keep the count accurate remove_action( ‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10,…Continue reading
// 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
// Save Stripe Customer ID to user meta upon user registration add_action( ‘gform_after_submission’, function ( $entry, $form ) { $form_ids = array(3,4,12); if ( ! in_array( (int)$form[‘id’], $form_ids, true ) ) { return; } // Retrieve the Stripe Customer ID…Continue reading
function vturb_shortcode_handler($atts, $content = null) { // Parse attributes $atts = shortcode_atts( [ ‘fullscreen’ => ‘true’, // Enable fullscreen experience (true/false) ], $atts, ‘vturb’ ); // Validate fullscreen attribute $fullscreen_enabled = filter_var($atts[‘fullscreen’], FILTER_VALIDATE_BOOLEAN); ob_start(); // Start output buffering ?>Continue reading
################################# # Page Edit View ################################# function add_page_meta_boxes() { add_meta_box( ‘page_type_meta_box’, __(‘Page Settings’), ‘render_page_meta_boxes’, ‘page’, ‘side’, ‘high’ // Ensures the meta box appears first ); } add_action(‘add_meta_boxes’, ‘add_page_meta_boxes’); // Render the Meta Box function render_page_meta_boxes($post) { // Get existing values…Continue reading
function remove_author_column_from_pages($columns) { if (isset($columns[‘author’])) { unset($columns[‘author’]); // Remove the “Author” column } return $columns; } add_filter(‘manage_page_posts_columns’, ‘remove_author_column_from_pages’);Continue reading