public static function render_preview() { self::process_data(); $iconShade = 'ml-icon-dark'; if (self::get_color_brightness(get_option('ml_preview_theme_color')) < 190) { $iconShade = 'ml-icon-white'; } Mobiloud_Admin::render_part_view('app_preview', compact('iconShade')); exit; }
/** * Initializes WordPress hooks */ private static function init_hooks() { self::$initiated = true; add_action('admin_init', array('Mobiloud_Admin', 'admin_init')); add_action('admin_menu', array('Mobiloud_Admin', 'admin_menu')); add_action('admin_head', 'ml_init_intercom'); add_action('admin_head', 'ml_init_perfect_audience'); add_action('admin_head', array('Mobiloud_Admin', 'check_mailing_list_alert')); add_action('wp_ajax_ml_save_initial_data', array('Mobiloud_Admin', 'save_initial_data')); add_action('wp_ajax_ml_save_editor', array('Mobiloud_Admin', 'save_editor')); add_action('wp_ajax_ml_save_banner', array('Mobiloud_Admin', 'save_banner')); add_action('wp_ajax_ml_tax_list', array('Mobiloud_Admin', 'get_tax_list')); }
function ml_push_notification_manual_send_callback() { if (isset($_POST['ml_push_notification_msg'])) { $platform = array(); switch ($_POST['ml_push_notification_os']) { case 'all': $platform = array(0, 1); break; case 'android': $platform = array(1); break; case 'ios': $platform = array(0); break; } $tags = array(); $tagNames = array(); $postId = null; if (strlen($_POST['ml_push_notification_data_id']) > 0) { if (strpos($_POST['ml_push_notification_data_id'], 'custom') !== false) { $postId = $_POST['ml_push_notification_post_id']; } else { $postId = substr($_POST['ml_push_notification_data_id'], 8); } } if ($postId != null) { $tags = ml_get_post_tag_ids($postId); $tagNames = ml_get_post_tags($postId); } $tags[] = 'all'; $tagNames[] = 'all'; $payload = array(); if ($postId !== null) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($postId), 'single-post-thumbnail'); $payload = array('post_id' => $postId); if (is_array($image)) { $payload['featured_image'] = $image[0]; } } $data = array('platform' => $platform, 'msg' => trim($_POST['ml_push_notification_msg']), 'sound' => 'default', 'badge' => null, 'notags' => true, 'tags' => $tags, 'payload' => $payload); ml_pb_send_batch_notification($data, $tagNames); Mobiloud_Admin::track_user_event('push_notification'); } ml_push_notification_manual_send(); die; }
<?php Mobiloud_Admin::render_remote_view('get_started_publish');
</a> </li> <?php } ?> </ul> </div> </div> <?php } ?> <h2 class="nav-tab-wrapper get-started-tabs"> <?php foreach (Mobiloud_Admin::get_started_tasks() as $task_key => $task) { ?> <?php $active_task = ''; if (!isset($_GET['tab']) && $task_key == 'design' || isset($_GET['tab']) && $_GET['tab'] == $task_key) { $active_task = 'nav-tab-active'; } ?> <a class="nav-tab <?php echo $active_task; ?> " href="<?php echo admin_url('admin.php?page=mobiloud&tab=' . $task_key); ?> "><?php echo esc_html($task['nav_text']);