Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mahesh Waghmare maheshwaghmare

🎯
Focusing
View GitHub Profile
@maheshwaghmare
maheshwaghmare / disable-5-start-notice.php
Created Mar 22, 2021
Disable the Starter Templates five star admin notice.
View disable-5-start-notice.php
<?php
if( is_callable( 'Astra_Sites_Admin::get_instance' ) ) {
remove_action( 'admin_notices', array( Astra_Sites_Admin::get_instance(), 'admin_notices' ) );
}
View figlet-fonts.txt
__ ____
/ / ____ ________ ____ ___ / _/___ _______ ______ ___
/ / / __ \/ ___/ _ \/ __ `__ \ / // __ \/ ___/ / / / __ `__ \
/ /___/ /_/ / / / __/ / / / / / _/ // /_/ (__ ) /_/ / / / / / /
/_____/\____/_/ \___/_/ /_/ /_/ /___/ .___/____/\__,_/_/ /_/ /_/
/_/
Font Info: Slant by Glenn Chappell 3/93 -- based on Standard
@maheshwaghmare
maheshwaghmare / show-post-navigation.php
Last active Sep 18, 2020
WordPress - Show the (next and previous) navigation for post, page and custom post types (CPT). Use `[show_post_navigation]`
View show-post-navigation.php
<?php
/**
* Show the (next and previous) navigation for post, page and custom post types (CPT).
*
* @example [show_post_navigation]
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*/
@maheshwaghmare
maheshwaghmare / rss-feed-shortcode.php
Created Sep 4, 2020
Show WordPress RSS Feed with Shortcode. E.g. [show_rss_feed url="https://maheshwaghmare.com/feed/"]
View rss-feed-shortcode.php
<?php
/**
* Show RSS feed with Shortcode.
*
* @example [show_rss_feed url="https://maheshwaghmare.com/feed/"]
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*/
@maheshwaghmare
maheshwaghmare / add-post-type-to-feed.php
Created Sep 4, 2020
WordPress: Add custom post types into the feed.
View add-post-type-to-feed.php
<?php
/**
* Add Custom Post Types (CPT) to feeds
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*
* @return object
*/
@maheshwaghmare
maheshwaghmare / child-pages-list.php
Created Sep 3, 2020
List all the pages in list with `[child_pages_list]` shortcode in WordPress.
View child-pages-list.php
<?php
add_shortcode( 'child_pages_list', function() {
$args = array(
'post_parent' => get_the_ID(),
'post_type' => get_post_type(),
);
$posts = get_children( $args );
ob_start();
@maheshwaghmare
maheshwaghmare / pluign-get-deactivate-link.php
Created Aug 16, 2020
WordPress get plugin deactivate link.
View pluign-get-deactivate-link.php
@maheshwaghmare
maheshwaghmare / copy-as-html.php
Created Aug 2, 2020
Copy anything to Clipboard: Allow to copy as HTML. See https://maheshwaghmare.com/?p=8138
View copy-as-html.php
<?php
/**
* Allow to copy as HTML.
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*
* @return mixed
*/
@maheshwaghmare
maheshwaghmare / sample-plugin.php
Created Jul 18, 2020
Sample Plugin - Create new user role and new post type and allow to create the custom post type with those users who have that specific user role.
View sample-plugin.php
<?php
<?php
/**
* Plugin name: Sample Plugin
*/
/**
* User Role Specific Post Type
*
* @package User Role Specific Post Type
@maheshwaghmare
maheshwaghmare / add-tag-in-rest-field.php
Created Jul 16, 2020
WP Portfolio - Add tags in UI grid
View add-tag-in-rest-field.php
<?php
add_action( 'rest_api_init', 'wp_portfolio_add_rest_field' );
/**
* Add Rest Field
*
* @since 1.0.0
* @return void
*/
function wp_portfolio_add_rest_field() {