_x( 'Ticker', 'taxonomy general name' ), 'singular_name' => _x( 'Ticker', 'taxonomy singular name' ), 'search_items' => __( 'Search Tickers', 'wplt2' ), 'all_items' => __( 'All Tickers', 'wplt2' ), 'parent_item' => __( 'Parent Ticker', 'wplt2' ), 'parent_item_colon' => __( 'Parent Ticker:', 'wplt2' ), 'edit_item' => __( 'Edit Ticker', 'wplt2' ), 'update_item' => __( 'Update Ticker', 'wplt2' ), 'add_new_item' => __( 'Add New Ticker', 'wplt2' ), 'new_item_name' => __( 'New Ticker', 'wplt2' ), 'menu_name' => __( 'Ticker', 'wplt2' ), ); register_taxonomy( 'wplt2_ticker', array( 'wplt2_tick' ), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, ) ); // Post type arguments. $args = array( 'labels' => array( 'name' => __( 'Ticks', 'wplt2' ), 'singular_name' => __( 'Tick', 'wplt2' ), 'add_new' => __( 'Add New', 'wplt2' ), 'add_new_item' => __( 'Add New Tick', 'wplt2' ), 'edit_item' => __( 'Edit Tick', 'wplt2' ), 'new_item' => __( 'New Tick', 'wplt2' ), 'all_items' => __( 'All Ticks', 'wplt2' ), 'view_item' => __( 'View Tick', 'wplt2' ), 'search_items' => __( 'Search Ticks', 'wplt2' ), 'not_found' => __( 'No Ticks found', 'wplt2' ), 'not_found_in_trash' => __( 'No Ticks found in Trash', 'wplt2' ), 'parent_item_colon' => '', 'menu_name' => __( 'Liveticker', 'wplt2' ), ), 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'menu_icon' => 'dashicons-rss', 'capability_type' => 'post', 'supports' => array( 'title', 'editor', 'author' ), 'taxonomies' => array( 'wplt2_ticker' ), ); register_post_type( 'wplt2_tick', $args ); } /** * Output Liveticker * * @param array $atts Shortcode attributes. * * @return string */ public static function shortcode_ticker_show( $atts ) { // Indicate presence of shortcode (to enqueue styles/scripts later). self::$shortcode_present = true; // Initialize output. $output = ''; // Check if first attribute is filled. if ( $atts['ticker'] ) { // Set limit to infinite, if not set explicitly. if ( ! isset( $atts['limit'] ) ) { $atts['limit'] = - 1; } $output = '
' . get_the_time( 'd.m.Y H.i' ) . ' ' . get_the_title() . '
' . get_the_content() . '