This file contains hidden or 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 | |
/** | |
* Insert an attachment from an URL address. | |
* | |
* @param String $url | |
* @param Int $parent_post_id | |
* @return Int Attachment ID | |
*/ | |
function crb_insert_attachment_from_url($url, $parent_post_id = null) { |
This file contains hidden or 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 | |
*/ | |
const { __ } = wp.i18n; | |
const { registerBlockStyle } = wp.blocks; | |
registerBlockStyle( 'core/image' , { | |
name: 'default', | |
label: __( 'Default' ), | |
isDefault: true, |
This file contains hidden or 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.domReady( () => { | |
wp.blocks.registerBlockStyle( 'core/image', { | |
name: 'default', | |
label: __( 'Default' ), | |
isDefault: true, | |
} ); | |
wp.blocks.registerBlockStyle( 'core/image', { | |
name: 'circular-image', |
This file contains hidden or 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
.is-style-circular-image img{ | |
border-radius: 9999px !important; | |
object-fit: cover; | |
overflow: hidden; | |
} | |
.is-style-rounded-corners img{ | |
border-radius: 0.5em; | |
overflow: hidden; | |
} |
This file contains hidden or 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 Support for EditorsKit Plugin | |
* | |
* @package Jarvis | |
* @subpackage EditorsKit | |
* @author Jeffrey Carandang <jeffreycarandang.com> | |
* @link https://editorskit.com/ | |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License | |
*/ |
This file contains hidden or 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
const defaultConfig = require( './node_modules/@wordpress/scripts/config/webpack.config.js' ); | |
const path = require( 'path' ); | |
const postcssPresetEnv = require( 'postcss-preset-env' ); | |
const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' ); | |
const IgnoreEmitPlugin = require( 'ignore-emit-webpack-plugin' ); | |
const production = process.env.NODE_ENV === ''; | |
module.exports = { | |
...defaultConfig, |
This file contains hidden or 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 | |
/** | |
* Plugin Name: My Custom Block | |
* Plugin URI: https://github.com/phpbits/my-custom-block | |
* Description: Custom Gutenberg block for tutorial purposes | |
* Version: 1.0 | |
* Author: Jeffrey Carandang | |
* Author URI: https://jeffreycarandang.com/ | |
* | |
* @category Gutenberg |
This file contains hidden or 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
/** | |
* Internal dependencies | |
*/ | |
import './blocks/container'; |
This file contains hidden or 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 | |
*/ | |
const { __ } = wp.i18n; | |
const { registerBlockType } = wp.blocks; | |
const { InnerBlocks } = wp.blockEditor; | |
registerBlockType( 'custom-block/container', { | |
title: __( 'Custom Container' ), |
This file contains hidden or 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
@import "./blocks/container/editor.scss"; |