Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
byp
/
wp-content
/
plugins
/
convertkit
/
includes
:
class-convertkit-shortcodes.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php /** * Note: This file may contain artifacts of previous malicious infection. * However, the dangerous code has been removed, and the file is now safe to use. */ ?> <?php /** * ConvertKit Shortcodes class. * * @package ConvertKit * @author ConvertKit */ /** * Registers shortcodes defined in the `convertkit_shortcodes` filter as WordPress Shortcodes. * * @package ConvertKit * @author ConvertKit */ class ConvertKit_Shortcodes { /** * Constructor * * @since 1.9.6 */ public function __construct() { add_action( 'init', array( $this, 'init' ), 10, 1 ); } /** * Register ConvertKit shortcodes. * * @since 1.9.6 */ public function init() { // Get shortcodes. $shortcodes = convertkit_get_shortcodes(); // Bail if no shortcodes are available. if ( ! is_array( $shortcodes ) || ! count( $shortcodes ) ) { return; } // Iterate through shortcodes, registering them as shortcodes. foreach ( $shortcodes as $shortcode => $properties ) { // Register shortcode. add_shortcode( 'convertkit_' . $shortcode, array( $properties['render_callback'][0], $properties['render_callback'][1], ) ); // For the Form shortcode, register the [convertkit] shortcode for backward compatibility. if ( $shortcode === 'form' ) { add_shortcode( 'convertkit', array( $properties['render_callback'][0], $properties['render_callback'][1], ) ); } } } }