This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * GT Link Manager — One-time prefix migration snippet. | |
| * | |
| * Paste this into your theme's functions.php (or a mu-plugin) BEFORE updating | |
| * GT Link Manager to v1.4.0+. It renames the old gt_ prefix tables and options | |
| * to the new gtlm_ prefix so existing data carries over seamlessly. | |
| * | |
| * After the migration runs once, you can safely remove this snippet. | |
| * Check wp_options for 'gtlm_prefix_migrated' = '1' to confirm it ran. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Rank Math SEO: Tangible Loops & Logic block content integration | |
| * | |
| * Feeds tangible/template block content into Rank Math's SEO analysis. | |
| * Supports inline editor templates and selected template posts. | |
| * Does NOT hook the [template] shortcode. | |
| * | |
| * Usage: Drop into functions.php or Code Snippets plugin. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: MailerPress Substack Importer | |
| * Description: WP-CLI command to import Substack newsletters into MailerPress campaigns with public URLs. | |
| * Version: 1.0.0 | |
| * Requires PHP: 8.2 | |
| * | |
| * Usage: | |
| * wp substack-import https://gauravtiwari.substack.com/feed --dry-run | |
| * wp substack-import https://gauravtiwari.substack.com/feed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('style_loader_tag', 'gt_inline_small_css', 10, 4); | |
| function gt_inline_small_css($tag, $handle, $href, $media) { | |
| // Frontend only - skip admin, customizer, and login | |
| if (is_admin() || is_customize_preview() || $GLOBALS['pagenow'] === 'wp-login.php') { | |
| return $tag; | |
| } | |
| // Size threshold in bytes (15KB) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'enqueue_block_editor_assets', function() { | |
| wp_add_inline_style( 'wp-edit-post', ' | |
| .edit-post-meta-boxes-main { | |
| max-height: unset !important; | |
| height: auto !important; | |
| } | |
| ' ); | |
| } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function gaurav_custom_meta_keywords() { | |
| $keywords = ''; // Initialize keywords variable | |
| if (is_singular('post')) { | |
| // For singular posts, get the terms | |
| $post_id = get_the_ID(); | |
| $terms_array = array(); // Initialize terms array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function add_custom_post_counts() { | |
| $post_types = get_post_types(array('public' => true, '_builtin' => false), 'objects'); | |
| foreach($post_types as $post_type) { | |
| $num_posts = wp_count_posts($post_type->name); | |
| $num = number_format_i18n($num_posts->publish); | |
| $text = _n($post_type->labels->singular_name, $post_type->labels->name, intval($num_posts->publish)); | |
| if(current_user_can('edit_posts')) { | |
| $output = '<a href="edit.php?post_type=' . $post_type->name . '">' . $num . ' ' . $text . '</a>'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Disable smart quotes globally | |
| remove_filter('the_content', 'wptexturize'); | |
| remove_filter('the_title', 'wptexturize'); | |
| remove_filter('the_excerpt', 'wptexturize'); | |
| remove_filter('comment_text', 'wptexturize'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function gaurav_custom_meta_keywords() { | |
| $keywords = ''; // Initialize keywords variable | |
| if (is_singular('post')) { | |
| // For singular posts, get the terms | |
| $post_id = get_the_ID(); | |
| $terms_array = array(); // Initialize terms array | |
| // Get terms from categories, tags, and custom taxonomies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php function remove_post_formats_support() { | |
| remove_theme_support('post-formats'); | |
| } | |
| add_action('after_setup_theme', 'remove_post_formats_support', 11); |
NewerOlder