PATH:
home
/
lab2454c
/
incforce.com
/
wp-content
/
plugins
/
paid-memberships-pro
/
blocks
/
account-invoices-section
<?php /** * Sets up account-invoices-section block, does not format frontend * * @package blocks/account-invoices-section **/ namespace PMPro\blocks\account_invoices_section; defined( 'ABSPATH' ) || die( 'File cannot be accessed directly' ); // Only load if Gutenberg is available. if ( ! function_exists( 'register_block_type' ) ) { return; } add_action( 'init', __NAMESPACE__ . '\register_dynamic_block' ); /** * Register the dynamic block. * * @since 2.1.0 * * @return void */ function register_dynamic_block() { // Hook server side rendering into render callback. register_block_type( 'pmpro/account-invoices-section', [ 'render_callback' => __NAMESPACE__ . '\render_dynamic_block', 'attributes' => array( 'title' => array( 'type' => 'string', 'default' => __( 'Past Invoices', 'paid-memberships-pro' ) ) ), ] ); } /** * Server rendering for account-invoices-section block. * * @return string **/ function render_dynamic_block( $attributes ) { $title = isset( $attributes['title'] ) ? $attributes['title'] : null; return pmpro_shortcode_account( array( 'sections' => 'invoices', 'title' => $title ) ); }
[-] block.php
[edit]
[+]
..
[-] block.js
[edit]