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
// initial page load's url | |
// Change port number to your local WP instance. | |
function url() { | |
return "http://localhost:4759/wp-admin/site-editor.php?postType=wp_template&postId=twentytwentytwo%2F%2Ffront-page"; | |
} | |
// The setup method doesn't seem to get called | |
// async function setup(page) { | |
// await page.$eval("#user_login", (el) => (el.value = "admin")); | |
// await page.$eval("#user_pass", (el) => (el.value = "password")); | |
// await page.click("#wp-submit"); |
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
.components-range-control__mark { | |
height: 4px; | |
width: 3px; | |
background-color: #ffffff; | |
z-index: 1; | |
} | |
.components-range-control__marks { | |
margin-top: 17px; | |
} |
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
.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient)::before, | |
.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background, | |
.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient)::before, | |
.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background { | |
opacity: 0.1; | |
} | |
.wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient)::before, | |
.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background, | |
.wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient)::before, | |
.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background { |
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
version: '3.7' | |
services: | |
mysql: | |
image: mariadb | |
ports: | |
- '3306' | |
environment: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: wordpress | |
volumes: |
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
{ | |
// Allow transform to new gallery format if experimental flag enabled. | |
type: 'block', | |
isMultiBlock: false, | |
blocks: [ 'core/gallery' ], | |
priority: 1, | |
isMatch( { ids } ) { | |
const settings = select( blockEditorStore ).getSettings(); | |
return settings.__experimentalGalleryRefactor && ids.length > 0; | |
}, |
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
/** | |
* External dependencies | |
*/ | |
import { isEmpty, noop } from 'lodash'; | |
/** | |
* WordPress dependencies | |
*/ | |
import { | |
Button, |
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
** | |
* WordPress dependencies | |
*/ | |
import { useEffect, useState } from '@wordpress/element'; | |
export default function useDimensionHander( | |
defaultWidth, | |
customWidth, | |
defaultHeight, | |
customHeight, |
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
/** | |
* External dependencies | |
*/ | |
import classnames from 'classnames'; | |
import { map, some } from 'lodash'; | |
/** | |
* WordPress dependencies | |
*/ | |
import { RichText, useBlockProps } from '@wordpress/block-editor'; |
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
function transform_new_gallery_block_to_unordered_list( $parsed_block ) { | |
if ( $parsed_block['blockName'] === 'core/gallery' && strpos( $parsed_block['innerHTML'], 'has-nested-images' ) ) { | |
forEach( $parsed_block['innerBlocks'] as &$value ) { | |
$value['innerHTML'] = '<li class="blocks-gallery-item">' . $value['innerHTML'] . '</li>'; | |
$value['innerContent'][0] = '<li class="blocks-gallery-item">' . $value['innerContent'][0] . '</li>'; | |
$value['innerHTML'] = preg_replace( '/(class="wp-image-(\d+)")/', '$1 data-d="$2"', $parsed_block['innerHTML'] ); | |
$value['innerContent'][0] = preg_replace( '/(class="wp-image-(\d+)")/', '$1 data-id="$2"', $value['innerContent'][0] ); | |
} | |
$parsed_block['innerHTML'] = preg_replace( '/(<figure.*>)/', '$1<ul ul class="blocks-gallery-grid">', $parsed_block['innerHTML'] ); | |
$parsed_block['innerHTML'] = preg_replace( '/<\/figure>/', '</ul></figure>', $parsed_block['innerHTML'] ); |
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
export function httpUpload(file) { | |
return Observable.create((observer) => { | |
var config = { | |
onUploadProgress: (progressEvent) => { | |
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total); | |
observer.next({ progress: percentCompleted }); | |
} | |
}; | |
axios.post(`${appConfig.apiUrl}/upload`, file, config) | |
.then((response) => { |
NewerOlder