Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mahesh Waghmare maheshwaghmare

🎯
Focusing
View GitHub Profile
@maheshwaghmare
maheshwaghmare / gtag.php
Created January 20, 2023 12:34
Add/Modify Google tag manager variables for Rank Math SEO
View gtag.php
<?php
if ( ! function_exists( 'prefix_analytics_gtag_config' ) ) :
/**
* Add/Modify Google tag manager variables
*
* @param array $args Google analytics arguments
*/
function prefix_analytics_gtag_config( $args = [] ) {
@maheshwaghmare
maheshwaghmare / increase-timeout.php
Created January 12, 2023 11:49
Increase the page speed request timeout from 30 seconds to 90 seconds.
View increase-timeout.php
<?php
add_filter( 'http_request_args', 'prefix_http_request_args', 10, 2 );
function prefix_http_request_args( $parsed_args, $url ) {
if ( false === strpos( $url, 'runPagespeed' ) ) {
return $parsed_args;
}
// Set timeout with 90 seconds.
$parsed_args['timeout'] = 90;
View remove-spaces.php
<?php
if ( ! function_exists( 'prefix_remove_spaces' ) ) :
/**
* Remove spaces
*
* @param array $args Arguments.
* @return array
*
* @see https://wp.me/P4Ams0-9Sn
@maheshwaghmare
maheshwaghmare / snippet.php
Created July 26, 2022 20:44
After Copy Redirect to Page (Copy Anything to Clipboard) - See https://wp.me/P4Ams0-aAq
View snippet.php
<?php
if ( ! function_exists( 'prefix_copy_the_code_localize_vars' ) ) :
/**
* Localize vars.
*
* @return array
*/
function prefix_copy_the_code_localize_vars( $args = array() ) {
// Redirect to page url.
@maheshwaghmare
maheshwaghmare / mime.php
Last active October 11, 2021 09:51
Modify the MIME types of the Starter Templates
View mime.php
<?php
if ( ! function_exists( 'prefix_modify_mime_type' ) ) :
/**
* Modify the MIME types.
*
* @since x.x.x
*
* @param array $args File upload arguments.
* @return array.
@maheshwaghmare
maheshwaghmare / README.md
Created June 12, 2021 13:25
webpagetest.org API example
View README.md

We can test our website speed on website https://webpagetest.org.

If you are developer and what to test your website though coding then checkout below Webpagetest API example.

We send the Webpagetest API rest request to test the site.

@maheshwaghmare
maheshwaghmare / change-text.php
Created May 19, 2021 05:54
WP Portfolio - Change load more button text
View change-text.php
<?php
/**
* Change Button Text
*
* @todo Change the `prefix_` with your own unique string.
*
* @param string $button_text.
* @return string
*/
function prefix_change_load_more_text( $button_text = '' ) {
@maheshwaghmare
maheshwaghmare / disable-5-start-notice.php
Created March 22, 2021 12:53
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' ) );
}
@maheshwaghmare
maheshwaghmare / figlet-fonts.txt
Created February 24, 2021 15:47
Figlet Fonts (ASCII Fonts) examples - See https://maheshwaghmare.com/?p=37127
View figlet-fonts.txt
__ ____
/ / ____ ________ ____ ___ / _/___ _______ ______ ___
/ / / __ \/ ___/ _ \/ __ `__ \ / // __ \/ ___/ / / / __ `__ \
/ /___/ /_/ / / / __/ / / / / / _/ // /_/ (__ ) /_/ / / / / / /
/_____/\____/_/ \___/_/ /_/ /_/ /___/ .___/____/\__,_/_/ /_/ /_/
/_/
Font Info: Slant by Glenn Chappell 3/93 -- based on Standard
@maheshwaghmare
maheshwaghmare / show-post-navigation.php
Last active September 18, 2020 20:48
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
*/