// Change POSTS to News in WP dashboard add_action( ‘admin_menu’, ‘rd_change_post_menu_label’ ); add_action( ‘init’, ‘rd_change_post_object_label’ ); function rd_change_post_menu_label() { global $menu; global $submenu; $menu[5][0] = ‘News’; $submenu[‘edit.php’][5][0] = ‘News’; $submenu[‘edit.php’][10][0] = ‘Add News’; $submenu[‘edit.php’][16][0] = ‘News Tags’; echo ”; }…Continue reading
function custom_realtime_find_replace($content) { // Define your replacement rules $rules = [ // Example “SOME_KEY_001” => “SOME_VALUE”, “SOME_KEY_002” => “SOME_VALUE2”, ]; // Loop through the rules and replace content foreach ($rules as $find => $replace) { $content = str_replace($find, $replace, $content);…Continue reading
add_action(‘init’, function () { remove_action(‘wp_head’, ‘wp_resource_hints’, 2, 99); }); /** * Disable emojis */ add_action(‘init’, function () { remove_action(‘wp_head’, ‘print_emoji_detection_script’, 7); remove_action(‘admin_print_scripts’, ‘print_emoji_detection_script’); remove_action(‘wp_print_styles’, ‘print_emoji_styles’); remove_action(‘admin_print_styles’, ‘print_emoji_styles’); remove_filter(‘the_content_feed’, ‘wp_staticize_emoji’); remove_filter(‘comment_text_rss’, ‘wp_staticize_emoji’); remove_filter(‘wp_mail’, ‘wp_staticize_emoji_for_email’); add_filter(‘tiny_mce_plugins’, function ($plugins) { if (is_array($plugins)) {…Continue reading
function add_custom_javascript() { // Check if we’re on a single post or page if(is_singular()) { // Get the post ID of the current post or page $post_id = get_the_ID(); // Check if the custom field ‘funnel’ exists and get its…Continue reading
function disable_content_title_for_all_posts() { $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, ‘fields’ => ‘ids’, // Only get post IDs to improve performance ); $posts = get_posts($args); foreach ($posts as $post_id) { // Assuming ‘_disable_title’ is the meta key and…Continue reading
add_filter(‘rest_endpoints’, function( $endpoints ) { if ( isset( $endpoints[‘/wp/v2/users’] ) ) { unset( $endpoints[‘/wp/v2/users’] ); } if ( isset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ) ) { unset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ); } return $endpoints; });Continue reading
function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’, ‘wpcode_snippet_add_slug_body_class’ );Continue reading
add_filter( ‘wpforms_webhooks_process_fill_http_body_params_value’, function ( $filled_params, $params, $process ) { foreach ( $filled_params as $key => $param ) { if ( $key == “booking_date” ) { $filled_params[ $key ] = $param[‘value’]; } elseif ( $key == “start_time” ) { $filled_params[ $key…Continue reading
/** * Replace the `ver` query arg with the file’s last modified timestamp * * @param string $src URL to a file * @return string Modified URL to a file */ function filter_cache_busting_file_src( $src = ” ) { global $wp_scripts;…Continue reading
if( function_exists(‘acf_add_local_field_group’) ): acf_add_local_field_group(array( ‘key’ => ‘group_2_sales’, ‘title’ => ‘Sales Profile’, ‘fields’ => array( array( ‘key’ => ‘field_2_sales_name’, ‘label’ => ‘Full Name’, ‘name’ => ‘sales_name’, ‘type’ => ‘text’, ‘instructions’ => ‘Enter the full name of the salesperson.’, ‘required’ => 1,…Continue reading