public function admin_enqueue_scripts() { $script = new Prompt_Script(array('handle' => 'prompt-text-metabox', 'path' => 'js/text-metabox.js', 'dependencies' => array('jquery'))); $script->enqueue(); $env = array('custom_text_name' => self::$custom_text_name); $script->localize('prompt_text_metabox_env', $env); }
public static function enqueue_scripts($page) { if ('users.php' != $page) { return; } $script = new Prompt_Script(array('handle' => 'prompt-admin-users', 'path' => 'js/admin-users.js', 'dependencies' => array('jquery'))); $script->enqueue(); $script->localize('prompt_admin_users_env', array('export_url' => admin_url('admin-post.php?action=prompt_subscribers_export_csv'), 'export_label' => __('Export Postmatic Subscribers', 'Postmatic'))); }
/** * Enqueue scripts and styles. * * @since 1.0.0 */ public function page_head() { wp_enqueue_media(); wp_enqueue_style('prompt-admin', path_join(Prompt_Core::$url_path, 'css/admin.css'), array(), Prompt_Core::version()); wp_enqueue_style('datetimepicker', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.4.5/jquery.datetimepicker.min.css', array(), '2.4.5'); wp_enqueue_script('datetimepicker', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.4.5/jquery.datetimepicker.min.js', array(), '2.4.5'); $script = new Prompt_Script(array('handle' => 'prompt-options-page', 'path' => 'js/options-page.js', 'dependencies' => array('jquery-ui-tabs', 'datetimepicker'))); $script->enqueue(); $script->localize('prompt_options_page_env', array('email_header_image_prompt' => __('Choose an email header image', 'Postmatic'))); }
/** * @since 2.0.0 * * @param int $post_id Optionally supply which post to subscribe to. */ public static function enqueue_assets($post_id) { $script = new Prompt_Script(array('handle' => 'prompt-comment-form', 'path' => 'js/comment-form.js', 'dependencies' => array('jquery'))); $script->enqueue(); $script->localize('prompt_comment_form_env', array('url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce(Prompt_Ajax_Handling::AJAX_NONCE), 'action' => self::UNSUBSCRIBE_ACTION, 'post_id' => $post_id)); }
public function admin_enqueue_scripts() { $script = new Prompt_Script(array('handle' => 'prompt-post-editor', 'path' => 'js/post-editor.js', 'dependencies' => array('jquery'))); $script->enqueue(); }