26 lines
636 B
PHP
26 lines
636 B
PHP
<?php
|
|
namespace MailPoet\Config;
|
|
|
|
class Shortcodes {
|
|
function __construct() {
|
|
}
|
|
|
|
function init() {
|
|
// form widget shortcode
|
|
add_shortcode('mailpoet_form', array($this, 'formWidget'));
|
|
add_shortcode('wysija_form', array($this, 'formWidget'));
|
|
}
|
|
|
|
function formWidget($params = array()) {
|
|
// IMPORTANT: fixes conflict with MagicMember
|
|
remove_shortcode('user_list');
|
|
|
|
if(isset($params['id']) && (int)$params['id'] > 0) {
|
|
$form_widget = new \MailPoet\Form\Widget();
|
|
return $form_widget->widget(array(
|
|
'form' => (int)$params['id'],
|
|
'form_type' => 'shortcode'
|
|
));
|
|
}
|
|
}
|
|
} |