public function json_preview() { $data = stripslashes_deep($_POST); $opts = $data['opts']; $message = (object) array('ID' => true, 'post_title' => __('Slide-In Preview', 'wdsi'), 'post_content' => __('This preview message will demonstrate the current settings for position, width, theme, variation and color scheme. Please, don\'t forget to save your changes once you\'re happy with the result.', 'wdsi')); $opts['show_for-time'] = DAY_IN_SECONDS; $out = Wdsi_SlideIn::message_markup($message, $opts, false); wp_send_json_success(array('out' => $out)); }
function add_message() { if (defined('WDSI_BOX_RENDERED')) { return false; } if ($this->_is_wrong_place()) { return false; } global $post; // if is selected as no show, also return false if (!empty($post->ID)) { $do_not_show = get_post_meta($post->ID, 'wdsi_do_not_show', true); if ($do_not_show) { return false; } } $opts = get_option('wdsi'); $message = $this->_wdsi->get_message_data($post); if (!$message) { return false; } Wdsi_SlideIn::message_markup($message, $opts); define('WDSI_BOX_RENDERED', true); }