// Example usage.
import { parse } from '@wordpress/blocks'
const parsedContent = parse( content, {
__unstableSkipMigrationLogs: true,
} )
const blocks = findNestedBlocksByName( parsedContent, 'core/paragraph' );
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello World</title> | |
<style> | |
.card { | |
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); | |
transition: 0.3s; | |
width: 50%; |
This file contains 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 | |
if ( ! function_exists( 'prefix_rank_math_excluded_post_types' ) ) : | |
function prefix_rank_math_excluded_post_types( $post_types = [] ) { | |
// Add the post types which you want to exclude. | |
$excludes = [ | |
'plgnoptmzr_work', | |
]; | |
return array_diff_key( $post_types, array_flip( $excludes ) ); |
This file contains 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 | |
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 = [] ) { |
This file contains 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( '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; |
This file contains 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 | |
if ( ! function_exists( 'prefix_remove_spaces' ) ) : | |
/** | |
* Remove spaces | |
* | |
* @param array $args Arguments. | |
* @return array | |
* | |
* @see https://wp.me/P4Ams0-9Sn |
This file contains 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 | |
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. |
This file contains 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 | |
if ( ! function_exists( 'prefix_modify_mime_type' ) ) : | |
/** | |
* Modify the MIME types. | |
* | |
* @since x.x.x | |
* | |
* @param array $args File upload arguments. | |
* @return array. |
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.
This file contains 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 | |
/** | |
* 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 = '' ) { |
NewerOlder