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 | |
/** | |
* Generating your own custom RSS feed with custom URL and parameters | |
*/ | |
/** | |
* Initialise RSS feed | |
* @see https://developer.wordpress.org/reference/functions/add_feed/ | |
*/ | |
function init_rss_feed_custom( ) { |
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
/** | |
* Manipulates Slider Revolution HTML to make it more W3C compliant | |
* | |
* It's required to meet basic W3C accessibility standards. | |
* To make it work out, the following Slider Revolutions options have to be filled: | |
* - Slider title | |
* - Slider > Link & Seo > Enable Link = Enable | |
* - Slider > Link & Seo > Link Type = Regular | |
* - Slider > Slide Link > "The full page URL" | |
* - Slider > Slide info > A description with the same words from the slider 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
/** | |
* Simple dynamic block sample | |
* | |
* Creates a block that doesn't render the save side, because it's rendered on PHP | |
*/ | |
// Required components | |
const { __ } = wp.i18n; | |
const { registerBlockType, RichText } = wp.blocks; |
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 | |
/** | |
* CALLBACK | |
* | |
* Render callback for the dynamic block. | |
* | |
* Instead of rendering from the block's save(), this callback will render the front-end | |
* | |
* @since 1.0.0 | |
* @param $att Attributes from the JS block |
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 | |
/** | |
* Registers the dynamic server side block JS script and its styles | |
* | |
* @since 1.0.0 | |
* @return void | |
*/ | |
public function register_dynamic_block_action ( ) { | |
$block_name = 'block-dynamic'; |
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
/** | |
* Simple editable block with inspection controls | |
* | |
* Creates an editable block to make a link button, but with inspection controlls on the sidebar | |
*/ | |
/** | |
* Required components | |
*/ |
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
/** | |
* Simple editable block sample | |
* | |
* Creates an editable block to make a link | |
*/ | |
// Required components | |
const { __ } = wp.i18n; | |
const { registerBlockType, RichText, source } = wp.blocks; |
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
/** | |
* Simple block | |
* | |
* Creates a simple block that makes a red title | |
* | |
* @requires Gutenberg 4.3 | |
*/ | |
// Required components | |
const { registerBlockType } = wp.blocks; // registerBlockType function that creates a block |
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 | |
/** | |
* Registers a Gutenberg block JS script and its styles | |
* | |
* @since 1.0.0 | |
* @return void | |
*/ | |
public function register_block_action ( ) { | |
$block_name = 'my_block'; |
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 | |
/** | |
* template_include Filter callback | |
* | |
* Include plugin's template if there's one chosen for the rendering page | |
* | |
* @param string $template path | |
* @return string $template path | |
*/ | |
public function add_template_filter ( $template ) { |
NewerOlder