/**
  * Add templates for the key events on init
  * so theme templates can add their own
  */
 public static function add_templates()
 {
     // Allow plugins, themes, etc. to modify
     // the available key templates.
     self::$available_templates = apply_filters('liveblog_key_templates', self::$available_templates);
     // Allow plugins, themes, etc. to modify
     // the available key formats.
     self::$available_formats = apply_filters('liveblog_key_formats', self::$available_formats);
 }
Exemple #2
0
 /**
  * @uses add_action() to hook methods into WordPress actions
  * @uses add_filter() to hook methods into WordPress filters
  */
 public static function load()
 {
     load_plugin_textdomain('liveblog', false, dirname(plugin_basename(__FILE__)) . '/languages/');
     if (self::is_wp_too_old()) {
         self::add_old_wp_notice();
         return;
     }
     self::includes();
     self::add_actions();
     self::add_filters();
     self::add_admin_actions();
     self::add_admin_filters();
     self::register_embed_handlers();
     WPCOM_Liveblog_Entry_Key_Events::load();
     WPCOM_Liveblog_Entry_Extend::load();
     WPCOM_Liveblog_Lazyloader::load();
 }
 public static function delete_key($args)
 {
     if (!$args['entry_id']) {
         return new WP_Error('entry-delete', __('Missing entry ID', 'liveblog'));
     }
     if (!WPCOM_Liveblog_Entry_Key_Events::remove_key_action($args['entry_id'])) {
         return new WP_Error('entry-delete-key', __('Key event not deleted'));
     }
     $entry = self::update($args);
     return $entry;
 }
	<a class="link" href="#liveblog-entry-<?php 
echo esc_attr($entry_id);
?>
" data-entry-id="<?php 
echo esc_attr($entry_id);
?>
">
		<span class="date liveblog-time-update"><?php 
echo esc_html($entry_date);
?>
 - <?php 
echo esc_html($entry_time);
?>
</span>
		<span class="title"><?php 
echo WPCOM_Liveblog_Entry_Key_Events::get_formatted_content($content, $post_id);
?>
</span>
	</a>
	<?php 
if (WPCOM_Liveblog::current_user_can_edit_liveblog()) {
    ?>
		<span class="dashicons dashicons-no liveblog-key-event-delete" data-entry-id="<?php 
    echo $entry_id;
    ?>
"></span>
	<?php 
}
?>
</li>