Skip to content

Instantly share code, notes, and snippets.

View manishsongirkar's full-sized avatar

Manish Songirkar manishsongirkar

  • rtCamp
  • Pune, India
  • 18:57 (UTC +05:30)
View GitHub Profile
@manishsongirkar
manishsongirkar / show_local_site_links.sh
Created November 6, 2025 09:18
Show local site links in terminal
@manishsongirkar
manishsongirkar / download_vip_db.sh
Last active November 7, 2025 10:53
Download the database using WordPress VIP CLI
#!/usr/bin/env bash
download_vip_db() {
echo "Fetching application list from VIP CLI using 'vip app list'..."
# Run VIP app list and remove ANSI color codes
local APP_OUTPUT
APP_OUTPUT=$(vip app list 2>/dev/null)
if [ $? -ne 0 ] || [[ -z "$APP_OUTPUT" ]]; then
echo "❌ Error: Failed to execute 'vip app list'. Make sure you're logged in with 'vip login'."
@manishsongirkar
manishsongirkar / .gitignore_global
Created November 5, 2025 06:31
An example global gitignore file
# An example global gitignore file
#
# Place a copy if this at ~/.gitignore_global
# Run `git config --global core.excludesfile ~/.gitignore_global`
# Git #
#######
.git
.gitattributes
@manishsongirkar
manishsongirkar / check-elementor-editor.php
Created September 16, 2025 08:12
Checks if the current page is being viewed in the Elementor editor.
<?php
/**
* Checks if the current page is being viewed in the Elementor editor.
*
* This function determines if the user is currently in the Elementor
* page builder's edit or preview mode. It also returns true if
* the user is in the WordPress admin area, as Elementor's editor
* is a part of the admin interface.
*
@manishsongirkar
manishsongirkar / wp-toggle-admin-bar.php
Created June 2, 2025 12:52
WordPress Toggle Admin Bar
<?php
/**
* Plugin Name: WP Toggle Admin Bar
* Plugin URI: https://rtcamp.com/
* Description: A simple plugin to toggle the WordPress admin bar visibility for logged-in users.
* Version: 1.0.0
* Author: rtCamp
* Author URI: https://rtcamp.com/
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@manishsongirkar
manishsongirkar / editor-check-gutenberg-markup.php
Created July 24, 2023 11:23
Highlight on pages lists in editor if page is having Gutenberg markup or not.
<?php
function ms_filter_posts_columns( $columns ) {
$columns['gutenberg_markup'] = __( 'Gutenberg Markup?', 'text-domain' );
return $columns;
}
function ms_page_column( $column, $post_id ) {
@manishsongirkar
manishsongirkar / custom-fontawesome.js
Last active September 1, 2023 08:53
Fetch FontAwesome icons through JSON and generate custom data object in console
document.addEventListener( 'DOMContentLoaded', function() {
var getPost = async function() {
var response = await fetch( 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/6.x/metadata/icons.json' );
var icons = await response.json();
let fontAwesomeObj = {};
let currentObject = fontAwesomeObj;
Object.entries( icons ).forEach( ( [ key, icon ] ) => {
const styles = icon.styles;
@manishsongirkar
manishsongirkar / block-post-meta-register.php
Created May 22, 2023 11:10
Toggle option below featured image to show/hide featured image on frontend
<?php
/**
* Register post meta for featured image display.
*/
function register_block_post_meta() {
register_post_meta(
'post',
'featuredImageDisplay',
[
@manishsongirkar
manishsongirkar / all-blocks-list.js
Last active June 10, 2024 18:50
Gutenberg Block List
// All block lists.
wp.blocks.getBlockTypes();
// All Core blocks only.
wp.blocks.getBlockTypes().filter((block) => { return block.name.indexOf('core') !== -1});
// All block list name only.
wp.blocks.getBlockTypes().filter((block) => { console.log( block.name ) });
// All block list name only EXCLUDING child block.
@manishsongirkar
manishsongirkar / custom-post-format.php
Created October 9, 2015 07:41
Custom Post Format
<?php
/**
* Rename Aside post format to Look post format
*/
function rtp_rename_post_formats( $safe_text ) {
if ( $safe_text == __( 'Aside' , 'fab' ) ) {
return __( 'Look' , 'fab' );
}
return $safe_text;