Action
rpress_register_template_packs
Fires when template packs can be registered.
Runs once on init at priority 5, after the built-in Classic and Modern packs have been registered. Call rpress_register_template_pack() from a callback to add a pack with its id, label, template directory, stylesheet and design tokens. The pack then appears in the template selector on the Styles settings tab.
Available since RestroPress 3.4.
Example#
function my_register_template_pack() {
rpress_register_template_pack( array(
'id' => 'my_pack',
'label' => __( 'My Pack', 'my-textdomain' ),
'version' => '1.0.0',
'dir' => plugin_dir_path( __FILE__ ) . 'templates/my-pack',
'stylesheet' => plugin_dir_path( __FILE__ ) . 'css/my-pack.css',
'url' => plugins_url( 'css', __FILE__ ),
) );
}
add_action( 'rpress_register_template_packs', 'my_register_template_pack' );
Source#
Fired from:
includes/class-rpress-template-packs.php(line 149), inRPRESS_Template_Packs::register_packs()
See also#
Was this page helpful?
