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 Shortcodes | |
* Plugin URI: https://wordpress.org/plugins/my-custom-shortcodes/ | |
* Description: Custom shortcode for plugin development talk | |
* Version: 1.0 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.2 | |
* Author: Jeffrey Carandang | |
* Author URI: https://jeffreycarandang.com/ |
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 custom body class | |
**/ | |
add_filter('body_class', 'custom_body_class'); | |
function custom_body_class( $classes ) { | |
$classes[] = 'new-body-class'; | |
return $classes; | |
} | |
?> |
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 custom scripts | |
**/ | |
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' ); | |
function my_custom_scripts(){ | |
wp_enqueue_script( 'custom_js', plugins_url( 'js/custom.js', __FILE__ ), array(), '1.0.0', true ); | |
wp_register_style( 'custom_css', plugins_url( 'style.css', __FILE__ ), false, '1.0.0', true ); | |
wp_enqueue_style ( 'custom_css' ); |
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
.entry-content { | |
.wp-block-custom-block-container { | |
padding: 30px 50px; | |
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); | |
} | |
} |
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-block[data-type="custom-block/container"] { | |
> .block-editor-block-list__block-edit { | |
padding: 30px 50px; | |
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); | |
} | |
} |
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/style.scss"; |
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"; |
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
/** | |
* 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
<?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 |