Get Firebase ID Token

function testfbtoken( $wp_user, $firebase_idToken ) { // your custom code // $wp_user: object of WP_User class for the firebase logged in user // $firebase_idToken: JWT provided by Firebase echo $firebase_idToken; exit(); } add_action(‘mo_firebase_get_idtoken’, ‘testfbtoken’ , 10, 2);Continue reading

Allow SVG Files Upload (copy)

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Disable, Add, and Enable Thumbnail Sizes – reference

// disable generated image sizes //function tps_disable_image_sizes($sizes) { //unset($sizes[‘thumbnail’]); // disable thumbnail size //unset($sizes[‘medium’]); // disable medium size //unset($sizes[‘large’]); // disable large size //unset($sizes[‘medium_large’]); // disable medium-large size //unset($sizes[‘1536×1536’]); // disable 2x medium-large size //unset($sizes[‘2048×2048’]); // disable 2x large size…Continue reading

Add Attributes to Site Mobile Logo Image – reference

add_filter( ‘generate_mobile_header_logo_output’, function( $output ) { if ( ! function_exists( ‘generate_menu_plus_get_defaults’ ) ) { return $output; } $settings = wp_parse_args( get_option( ‘generate_menu_plus_settings’, array() ), generate_menu_plus_get_defaults() ); return sprintf( ‘ ‘, esc_url( apply_filters( ‘generate_logo_href’ , home_url( ‘/’ ) ) ), esc_attr(…Continue reading

Remove Post Title from Yoast Breadcrumb

/* Remove Post Title from Yoast Breadcrumb */ add_filter(‘wpseo_breadcrumb_single_link’, ‘remove_breadcrumb_title’ ); function remove_breadcrumb_title( $link_output) { if(strpos( $link_output, ‘breadcrumb_last’ ) !== false ) { $link_output = ”; } return $link_output; }Continue reading

Estimated reading time

// Estimated reading time function readTime ( $content = ”, $words_per_minute = 250, $with_gutenberg = false ) { // In case if content is build with gutenberg parse blocks if ( $with_gutenberg ) { $blocks = parse_blocks( $content ); $contentHtml…Continue reading

Remove Default jQuery

// Remove default WordPress jquery wp_deregister_script( ‘jquery’ ); //Remove jquery migrate add_action( ‘wp_default_scripts’, ‘remove_jquery_migrate’ ); function remove_jquery_migrate( $scripts ) { if ( ! is_admin() && isset( $scripts->registered[‘jquery’] ) ) { $script = $scripts->registered[‘jquery’]; if ( $script->deps ) { $script->deps =…Continue reading