'field', 'type' => $cfg['token'], 'label' => '', 'icon' => $cfg['icon'], 'usage_key' => $cfg['token'], 'schema' => array( 'props' => array( 'prefix_text' => array( 'type' => 'string', 'default' => $cfg['prefix'] ), 'html_id' => array( 'type' => 'string', 'default' => '' ), 'cssclass' => array( 'type' => 'string', 'default' => '' ), 'help' => array( 'type' => 'string', 'default' => '' ), ), ), 'templates_printer' => $cfg['templates_printer'], ); return $packs; } /** * Enqueue a generic hint shortcode pack script. * * @param string $page Current admin page slug. * @param array $cfg Pack config. * * @return void */ function wpbc_bfb_hint_shortcode_enqueue_js( $page, $cfg ) { if ( WPBC_BFB_BUILDER_PAGE_SLUG !== $page ) { return; } wp_enqueue_script( 'wpbc-bfb_hint_shortcode_wptpl_shared', wpbc_plugin_url( '/includes/page-form-builder/field-packs/_shared/_out/hint-shortcode-wptpl.js' ), array( 'wp-util', 'wpbc-bfb' ), WP_BK_VERSION_NUM, true ); wp_enqueue_script( $cfg['handle'], wpbc_plugin_url( '/includes/page-form-builder/field-packs/' . $cfg['folder'] . '/_out/' . $cfg['script_file'] ), array( 'wpbc-bfb_hint_shortcode_wptpl_shared' ), WP_BK_VERSION_NUM, true ); wp_localize_script( $cfg['handle'], $cfg['boot_var'], array( 'is_supported' => wpbc_bfb_hint_shortcode_is_supported( $cfg ) ? 1 : 0, 'upgrade_text' => $cfg['upgrade_text'], 'preview_value' => $cfg['preview_value'], ) ); } /** * Print wp.template() blocks for a generic hint shortcode pack. * * @param string $page Current admin page slug. * @param array $cfg Pack config. * * @return void */ function wpbc_bfb_hint_shortcode_print_templates( $page, $cfg ) { if ( WPBC_BFB_BUILDER_PAGE_SLUG !== $page ) { return; } $token = $cfg['token']; $shortcode_display = $cfg['shortcode_display']; $template_id = 'wpbc-bfb-field-' . $token; $inspector_id = 'wpbc-bfb-inspector-' . $token; $exported = sprintf( /* translators: 1: Field prefix text. 2: Shortcode text. */ __( 'Exported output: %1$s [%2$s]', 'booking' ), $cfg['prefix'], $shortcode_display ); ?>
  • ' . esc_html( $cfg['pro_label'] ) . ''; } ?>