Add 2 custom widgets, change language strings from alx-extensions to alx

This commit is contained in:
Alexander Agnarson 2019-01-15 13:46:15 +01:00
parent 3b677f0df8
commit b2196ba561
11 changed files with 1053 additions and 170 deletions

View file

@ -2,11 +2,11 @@
/*
Plugin Name: Alx Extensions
Plugin URI: http://wordpress.org/plugins/alx-extensions/
Description: Extends free AlxMedia themes with additional features such as social share links, custom sidebars, thumbnail image upscale and post format meta boxes.
Version: 1.0.4
Description: Extends AlxMedia themes with additional features such as social share links, custom sidebars, thumbnail image upscale and post format meta boxes. Also includes 2 flexible custom widgets, Alx Tabs and Alx Posts.
Version: 1.0.5
Author: Alexander Agnarson
Author URI: http://alxmedia.se
Text Domain: alx-extensions
Text Domain: alx
Domain Path: /languages
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -21,15 +21,21 @@ require_once ALX_EXTENSIONS_DIR . '/inc/options.php';
require_once ALX_EXTENSIONS_DIR . '/inc/share.php';
require_once ALX_EXTENSIONS_DIR . '/inc/share-footer.php';
require_once ALX_EXTENSIONS_DIR . '/inc/post-formats.php';
require_once ALX_EXTENSIONS_DIR . '/inc/widgets/alx-posts.php';
require_once ALX_EXTENSIONS_DIR . '/inc/widgets/alx-tabs.php';
/* load plugin textdomain */
/* Load plugin textdomain
/* ------------------------------------ */
function alx_ext_load_textdomain() {
load_plugin_textdomain( 'alx-extensions', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
load_plugin_textdomain( 'alx', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
add_action( 'init', 'alx_ext_load_textdomain' );
/* enqueue scripts */
/* Enqueue scripts
/* ------------------------------------ */
function alx_ext_enqueue_scripts() {
if ( is_singular() ) {
wp_enqueue_script( 'alx-ext-sharrre', ALX_EXTENSIONS_URL . '/js/jquery.sharrre.min.js', array( 'jquery' ), '1.0.1' );
@ -38,7 +44,9 @@ function alx_ext_enqueue_scripts() {
add_action( 'wp_enqueue_scripts', 'alx_ext_enqueue_scripts' );
/* enqueue admin scripts */
/* Enqueue admin scripts
/* ------------------------------------ */
function alx_ext_enqueue_admin_scripts( $hook ) {
if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) {
wp_enqueue_script( 'alx-ext-post-formats', ALX_EXTENSIONS_URL . '/js/post-formats.js', array( 'jquery' ), '1.0.1' );
@ -47,7 +55,21 @@ function alx_ext_enqueue_admin_scripts( $hook ) {
add_action( 'admin_enqueue_scripts', 'alx_ext_enqueue_admin_scripts' );
/* Upscale cropped thumbnails */
/* Enqueue admin widgets css
/* ------------------------------------ */
function alx_ext_admin_widgets_css( $hook ) {
if ( 'widgets.php' != $hook ) {
return;
}
wp_enqueue_style( 'alx-ext-admin-widgets', ALX_EXTENSIONS_URL . '/inc/widgets/widgets.css' );
}
add_action( 'admin_enqueue_scripts', 'alx_ext_admin_widgets_css' );
/* Upscale cropped thumbnails
/* ------------------------------------ */
function alx_ext_thumbnail_upscale( $default, $orig_w, $orig_h, $new_w, $new_h, $crop ) {
if ( !$crop ) return null; // let the wordpress default function handle this
@ -69,7 +91,8 @@ if ( true === $enable_image_upscale ) {
}
/* Register custom sidebars
/* ------------------------------------ */
function alx_ext_register_custom_sidebars() {
if ( !get_theme_mod('sidebar-areas') =='' ) {
@ -85,5 +108,39 @@ function alx_ext_register_custom_sidebars() {
}
}
add_action( 'widgets_init', 'alx_ext_register_custom_sidebars', 11 );
/* Custom widgets
/* ------------------------------------ */
/* backwards compatibility (stop 2 of same widgets from loading)*/
/* alx-posts */
function roundtype_register_widget_posts() { }
function agnar_register_widget_posts() { }
function writeup_register_widget_posts() { }
function split_register_widget_posts() { }
function enspire_register_widget_posts() { }
function typecore_register_widget_posts() { }
function kontrast_register_widget_posts() { }
function slanted_register_widget_posts() { }
function magaziner_register_widget_posts() { }
function blogside_register_widget_posts() { }
function blogrow_register_widget_posts() { }
function anew_register_widget_posts() { }
/* alx-tabs */
function roundtype_register_widget_tabs() { }
function agnar_register_widget_tabs() { }
function writeup_register_widget_tabs() { }
function split_register_widget_tabs() { }
function enspire_register_widget_tabs() { }
function typecore_register_widget_tabs() { }
function kontrast_register_widget_tabs() { }
function slanted_register_widget_tabs() { }
function magaziner_register_widget_tabs() { }
function blogside_register_widget_tabs() { }
function blogrow_register_widget_tabs() { }
function anew_register_widget_tabs() { }

View file

@ -14,19 +14,19 @@ function alx_ext_custom_options() {
Kirki::add_panel( 'alx_extensions_panel', array(
'priority' => 11,
'title' => esc_html__( 'Theme Extensions', 'alx-extensions' ),
'title' => esc_html__( 'Theme Extensions', 'alx' ),
) );
Kirki::add_section( 'alx_extensions_social', array(
'priority' => 10,
'title' => esc_html__( 'Social Share', 'alx-extensions' ),
'title' => esc_html__( 'Social Share', 'alx' ),
'panel' => 'alx_extensions_panel',
) );
Kirki::add_field( 'enable_social_share', array(
'type' => 'switch',
'settings' => 'enable-social-share',
'label' => esc_html__( 'Enable Social Share', 'alx-extensions' ),
'label' => esc_html__( 'Enable Social Share', 'alx' ),
'section' => 'alx_extensions_social',
'default' => 'on',
) );
@ -34,56 +34,56 @@ function alx_ext_custom_options() {
Kirki::add_field( 'twitter_username', array(
'type' => 'text',
'settings' => 'twitter-username',
'label' => esc_html__( 'Twitter Username', 'alx-extensions' ),
'description' => esc_html__( 'Your @username will be added to share-tweets of your posts (optional)', 'alx-extensions' ),
'label' => esc_html__( 'Twitter Username', 'alx' ),
'description' => esc_html__( 'Your @username will be added to share-tweets of your posts (optional)', 'alx' ),
'section' => 'alx_extensions_social',
'default' => '',
) );
Kirki::add_section( 'alx_extensions_upscale', array(
'priority' => 10,
'title' => esc_html__( 'Image Upscale', 'alx-extensions' ),
'title' => esc_html__( 'Image Upscale', 'alx' ),
'panel' => 'alx_extensions_panel',
) );
Kirki::add_field( 'enable_image_upscale', array(
'type' => 'switch',
'settings' => 'enable-image-upscale',
'label' => esc_html__( 'Enable Image Upscale', 'alx-extensions' ),
'label' => esc_html__( 'Enable Image Upscale', 'alx' ),
'section' => 'alx_extensions_upscale',
'default' => 'on',
) );
Kirki::add_section( 'alx_extensions_custom_sidebars', array(
'priority' => 10,
'title' => esc_html__( 'Custom Sidebars', 'alx-extensions' ),
'title' => esc_html__( 'Custom Sidebars', 'alx' ),
'panel' => 'alx_extensions_panel',
) );
// Sidebars: Create Sidebars
Kirki::add_field( 'alx_sidebar', array(
'type' => 'repeater',
'label' => esc_html__( 'Create Sidebars', 'alx-extensions' ),
'description' => esc_html__( 'You must save and refresh the page to see your new sidebars.', 'alx-extensions' ),
'tooltip' => esc_html__( 'Make sure that you save and refresh the page if you can not see the sidebars you have created.', 'alx-extensions' ),
'label' => esc_html__( 'Create Sidebars', 'alx' ),
'description' => esc_html__( 'You must save and refresh the page to see your new sidebars.', 'alx' ),
'tooltip' => esc_html__( 'Make sure that you save and refresh the page if you can not see the sidebars you have created.', 'alx' ),
'section' => 'alx_extensions_custom_sidebars',
'row_label' => array(
'type' => 'text',
'value' => esc_html__('sidebar', 'alx-extensions' ),
'value' => esc_html__('sidebar', 'alx' ),
),
'settings' => 'sidebar-areas',
'default' => '',
'fields' => array(
'title' => array(
'type' => 'text',
'label' => esc_html__( 'Sidebar Title', 'alx-extensions' ),
'description' => esc_html__( 'The widget box title', 'alx-extensions' ),
'label' => esc_html__( 'Sidebar Title', 'alx' ),
'description' => esc_html__( 'The widget box title', 'alx' ),
'default' => '',
),
'id' => array(
'type' => 'text',
'label' => esc_html__( 'Sidebar ID', 'alx-extensions' ),
'description' => esc_html__( 'This ID must be unique', 'alx-extensions' ),
'label' => esc_html__( 'Sidebar ID', 'alx' ),
'description' => esc_html__( 'This ID must be unique', 'alx' ),
'default' => 'sidebar-',
),
)

View file

@ -9,7 +9,7 @@ function alx_ext_post_formats_meta_box( $meta_boxes ) {
/* ------------------------------------ */
$meta_boxes[] = array(
'id' => 'format-audio',
'title' => esc_html__( 'Format: Audio', 'alx-extensions' ),
'title' => esc_html__( 'Format: Audio', 'alx' ),
'post_types' => array( 'post' ),
'context' => 'advanced',
'priority' => 'high',
@ -18,7 +18,7 @@ function alx_ext_post_formats_meta_box( $meta_boxes ) {
array(
'id' => $prefix . 'audio_url',
'type' => 'text',
'name' => esc_html__( 'Audio URL', 'alx-extensions' ),
'name' => esc_html__( 'Audio URL', 'alx' ),
),
),
);
@ -27,7 +27,7 @@ function alx_ext_post_formats_meta_box( $meta_boxes ) {
/* ------------------------------------ */
$meta_boxes[] = array(
'id' => 'format-video',
'title' => esc_html__( 'Format: Video', 'alx-extensions' ),
'title' => esc_html__( 'Format: Video', 'alx' ),
'post_types' => array( 'post' ),
'context' => 'advanced',
'priority' => 'high',
@ -36,7 +36,7 @@ function alx_ext_post_formats_meta_box( $meta_boxes ) {
array(
'id' => $prefix . 'video_url',
'type' => 'text',
'name' => esc_html__( 'Video URL', 'alx-extensions' ),
'name' => esc_html__( 'Video URL', 'alx' ),
),
),
);

View file

@ -15,8 +15,8 @@ function alx_ext_sharrre_footer_template() {
?>
<div class="sharrre-footer group">
<div id="facebook-footer" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="<?php esc_attr_e('Share', 'alx-extensions'); ?>"></div>
<div id="twitter-footer" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="<?php esc_attr_e('Share', 'alx-extensions'); ?>"></div>
<div id="facebook-footer" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="<?php esc_attr_e('Share', 'alx'); ?>"></div>
<div id="twitter-footer" data-url="<?php echo the_permalink(); ?>" data-text="<?php echo the_title(); ?>" data-title="<?php esc_attr_e('Share', 'alx'); ?>"></div>
</div><!--/.sharrre-footer-->
<script type="text/javascript">
@ -26,7 +26,7 @@ function alx_ext_sharrre_footer_template() {
share: {
twitter: true
},
template: '<a class="box group" href="#"><div class="share"><i class="fa fa-twitter"></i><?php esc_html_e('Share', 'alx-extensions'); ?> <span><?php esc_html_e('on Twitter', 'alx-extensions'); ?></span><div class="count" href="#"><i class="fa fa-plus"></i></div></div></a>',
template: '<a class="box group" href="#"><div class="share"><i class="fa fa-twitter"></i><?php esc_html_e('Share', 'alx'); ?> <span><?php esc_html_e('on Twitter', 'alx'); ?></span><div class="count" href="#"><i class="fa fa-plus"></i></div></div></a>',
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: '<?php echo esc_attr( get_theme_mod('twitter-username') ); ?>'}},
@ -39,7 +39,7 @@ function alx_ext_sharrre_footer_template() {
share: {
facebook: true
},
template: '<a class="box group" href="#"><div class="share"><i class="fa fa-facebook-square"></i><?php esc_html_e('Share', 'alx-extensions'); ?> <span><?php esc_html_e('on Facebook', 'alx-extensions'); ?></span><div class="count" href="#">{total}</div></div></a>',
template: '<a class="box group" href="#"><div class="share"><i class="fa fa-facebook-square"></i><?php esc_html_e('Share', 'alx'); ?> <span><?php esc_html_e('on Facebook', 'alx'); ?></span><div class="count" href="#">{total}</div></div></a>',
enableHover: false,
enableTracking: true,
buttons:{layout: 'box_count'},

View file

@ -15,11 +15,11 @@ function alx_ext_sharrre_template() {
?>
<div class="sharrre-container sharrre-header group">
<span><?php esc_html_e('Share','alx-extensions'); ?></span>
<div id="twitter" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Tweet', 'alx-extensions'); ?>"></div>
<div id="facebook" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Like', 'alx-extensions'); ?>"></div>
<div id="pinterest" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Pin It', 'alx-extensions'); ?>"></div>
<div id="linkedin" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Share on LinkedIn', 'alx-extensions'); ?>"></div>
<span><?php esc_html_e('Share','alx'); ?></span>
<div id="twitter" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Tweet', 'alx'); ?>"></div>
<div id="facebook" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Like', 'alx'); ?>"></div>
<div id="pinterest" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Pin It', 'alx'); ?>"></div>
<div id="linkedin" data-url="<?php the_permalink(); ?>" data-text="<?php echo the_title_attribute(); ?>" data-title="<?php esc_attr_e('Share on LinkedIn', 'alx'); ?>"></div>
</div><!--/.sharrre-container-->
<script type="text/javascript">

208
inc/widgets/alx-posts.php Normal file
View file

@ -0,0 +1,208 @@
<?php
/*
AlxPosts Widget
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Copyright: (c) 2013 Alexander "Alx" Agnarson - http://alxmedia.se
@package AlxPosts
@version 1.0
*/
class AlxPosts extends WP_Widget {
/* Constructor
/* ------------------------------------ */
function __construct() {
parent::__construct( false, esc_html__( 'Alx Posts', 'alx' ), array('description' => esc_html__( 'Display posts from a category', 'alx' ), 'classname' => 'widget_alx_posts', 'customize_selective_refresh' => true ) );
}
public function alx_get_defaults() {
return array(
'title' => '',
// Posts
'posts_thumb' => 1,
'posts_category'=> 1,
'posts_date' => 1,
'posts_num' => '4',
'posts_cat_id' => '0',
'posts_orderby' => 'date',
'posts_time' => '0',
);
}
/* Widget
/* ------------------------------------ */
public function widget($args, $instance) {
extract( $args );
$defaults = $this -> alx_get_defaults();
$instance = wp_parse_args( (array) $instance, $defaults );
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
$output = $before_widget."\n";
if($title)
$output .= $before_title.$title.$after_title;
ob_start();
?>
<?php
$posts = new WP_Query( array(
'post_type' => array( 'post' ),
'showposts' => absint( $instance['posts_num'] ),
'cat' => absint( $instance['posts_cat_id'] ),
'ignore_sticky_posts' => true,
'orderby' => esc_attr( $instance['posts_orderby'] ),
'order' => 'dsc',
'date_query' => array(
array(
'after' => esc_attr( $instance['posts_time'] ),
),
),
) );
?>
<ul class="alx-posts group <?php if($instance['posts_thumb']) { echo 'thumbs-enabled'; } ?>">
<?php while ($posts->have_posts()): $posts->the_post(); ?>
<li>
<?php if($instance['posts_thumb']) { // Thumbnails enabled? ?>
<div class="post-item-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ): ?>
<?php the_post_thumbnail('alx-medium'); ?>
<?php else: ?>
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-medium.png" alt="<?php the_title_attribute(); ?>" />
<?php endif; ?>
<?php if ( has_post_format('video') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-play"></i></span>'; ?>
<?php if ( has_post_format('audio') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-volume-up"></i></span>'; ?>
<?php if ( is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-star"></i></span>'; ?>
</a>
</div>
<?php } ?>
<div class="post-item-inner group">
<?php if($instance['posts_category']) { ?><p class="post-item-category"><?php the_category(' / '); ?></p><?php } ?>
<p class="post-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></p>
<?php if($instance['posts_date']) { ?><p class="post-item-date"><?php the_time( get_option('date_format') ); ?></p><?php } ?>
</div>
</li>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</ul><!--/.alx-posts-->
<?php
$output .= ob_get_clean();
$output .= $after_widget."\n";
echo $output;
}
/* Widget update
/* ------------------------------------ */
public function update($new,$old) {
$instance = $old;
$instance['title'] = sanitize_text_field($new['title']);
// Posts
$instance['posts_thumb'] = $new['posts_thumb']?1:0;
$instance['posts_category'] = $new['posts_category']?1:0;
$instance['posts_date'] = $new['posts_date']?1:0;
$instance['posts_num'] = absint($new['posts_num']);
$instance['posts_cat_id'] = absint($new['posts_cat_id']);
$instance['posts_orderby'] = sanitize_text_field($new['posts_orderby']);
$instance['posts_time'] = sanitize_text_field($new['posts_time']);
return $instance;
}
/* Widget form
/* ------------------------------------ */
public function form($instance) {
// Default widget settings
$defaults = array(
'title' => '',
// Posts
'posts_thumb' => 1,
'posts_category' => 1,
'posts_date' => 1,
'posts_num' => '4',
'posts_cat_id' => '0',
'posts_orderby' => 'date',
'posts_time' => '0',
);
$instance = wp_parse_args( (array) $instance, $defaults );
?>
<div class="alx-options-posts">
<p>
<label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php esc_html_e( 'Title:', 'alx' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" type="text" value="<?php echo esc_attr( $instance["title"] ); ?>" />
</p>
<h4><?php esc_html_e( 'List Posts', 'alx' ); ?></h4>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('posts_thumb') ); ?>" name="<?php echo esc_attr( $this->get_field_name('posts_thumb') ); ?>" <?php checked( (bool) $instance["posts_thumb"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('posts_thumb') ); ?>"><?php esc_html_e( 'Show thumbnails', 'alx' ); ?></label>
</p>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("posts_num") ); ?>"><?php esc_html_e( 'Items to show', 'alx' ); ?></label>
<input style="width:20%;" id="<?php echo esc_attr( $this->get_field_id("posts_num") ); ?>" name="<?php echo esc_attr( $this->get_field_name("posts_num") ); ?>" type="text" value="<?php echo absint($instance["posts_num"]); ?>" size='3' />
</p>
<p>
<label style="width: 100%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("posts_cat_id") ); ?>"><?php esc_html_e( 'Category:', 'alx' ); ?></label>
<?php wp_dropdown_categories( array( 'name' => $this->get_field_name("posts_cat_id"), 'selected' => $instance["posts_cat_id"], 'show_option_all' => esc_html__( 'All', 'alx' ), 'show_count' => true ) ); ?>
</p>
<p style="padding-top: 0.3em;">
<label style="width: 100%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("posts_orderby") ); ?>"><?php esc_html_e( 'Order by:', 'alx' ); ?></label>
<select style="width: 100%;" id="<?php echo esc_attr( $this->get_field_id("posts_orderby") ); ?>" name="<?php echo esc_attr( $this->get_field_name("posts_orderby") ); ?>">
<option value="date"<?php selected( $instance["posts_orderby"], "date" ); ?>><?php esc_html_e( 'Most recent', 'alx' ); ?></option>
<option value="comment_count"<?php selected( $instance["posts_orderby"], "comment_count" ); ?>><?php esc_html_e( 'Most commented', 'alx' ); ?></option>
<option value="rand"<?php selected( $instance["posts_orderby"], "rand" ); ?>><?php esc_html_e( 'Random', 'alx' ); ?></option>
</select>
</p>
<p style="padding-top: 0.3em;">
<label style="width: 100%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("posts_time") ); ?>"><?php esc_html_e( 'Posts from:', 'alx' ); ?></label>
<select style="width: 100%;" id="<?php echo esc_attr( $this->get_field_id("posts_time") ); ?>" name="<?php echo esc_attr( $this->get_field_name("posts_time") ); ?>">
<option value="0"<?php selected( $instance["posts_time"], "0" ); ?>><?php esc_html_e( 'All time', 'alx' ); ?></option>
<option value="1 year ago"<?php selected( $instance["posts_time"], "1 year ago" ); ?>><?php esc_html_e( 'This year', 'alx' ); ?></option>
<option value="1 month ago"<?php selected( $instance["posts_time"], "1 month ago" ); ?>><?php esc_html_e( 'This month', 'alx' ); ?></option>
<option value="1 week ago"<?php selected( $instance["posts_time"], "1 week ago" ); ?>><?php esc_html_e( 'This week', 'alx' ); ?></option>
<option value="1 day ago"<?php selected( $instance["posts_time"], "1 day ago" ); ?>><?php esc_html_e( 'Past 24 hours', 'alx' ); ?></option>
</select>
</p>
<hr>
<h4><?php esc_html_e( 'Post Info', 'alx' ); ?></h4>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('posts_category') ); ?>" name="<?php echo esc_attr( $this->get_field_name('posts_category') ); ?>" <?php checked( (bool) $instance["posts_category"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('posts_category') ); ?>"><?php esc_html_e( 'Show categories', 'alx' ); ?></label>
</p>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('posts_date') ); ?>" name="<?php echo esc_attr( $this->get_field_name('posts_date') ); ?>" <?php checked( (bool) $instance["posts_date"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('posts_date') ); ?>"><?php esc_html_e( 'Show dates', 'alx' ); ?></label>
</p>
<hr>
</div>
<?php
}
}
/* Register widget
/* ------------------------------------ */
if ( ! function_exists( 'alx_register_widget_posts' ) ) {
function alx_register_widget_posts() {
register_widget( 'AlxPosts' );
}
}
add_action( 'widgets_init', 'alx_register_widget_posts' );

444
inc/widgets/alx-tabs.php Normal file
View file

@ -0,0 +1,444 @@
<?php
/*
AlxTabs Widget
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Copyright: (c) 2013 Alexander "Alx" Agnarson - http://alxmedia.se
@package AlxTabs
@version 1.0
*/
class AlxTabs extends WP_Widget {
/* Constructor
/* ------------------------------------ */
function __construct() {
parent::__construct( false, esc_html__( 'Alx Tabs', 'alx' ), array('description' => esc_html__('List posts, comments, and/or tags with or without tabs.', 'alx' ), 'classname' => 'widget_alx_tabs', 'customize_selective_refresh' => true ) );
}
public function alx_get_defaults() {
return array(
'title' => '',
'tabs_category' => 1,
'tabs_date' => 1,
// Recent posts
'recent_enable' => 1,
'recent_thumbs' => 1,
'recent_cat_id' => '0',
'recent_num' => '5',
// Popular posts
'popular_enable' => 1,
'popular_thumbs' => 1,
'popular_cat_id' => '0',
'popular_time' => '0',
'popular_num' => '5',
// Recent comments
'comments_enable' => 1,
'comments_avatars' => 1,
'comments_num' => '5',
// Tags
'tags_enable' => 1,
// Order
'order_recent' => '1',
'order_popular' => '2',
'order_comments' => '3',
'order_tags' => '4',
);
}
/* Create tabs-nav
/* ------------------------------------ */
private function _create_tabs($tabs,$count) {
// Borrowed from Jermaine Maree, thanks mate!
$titles = array(
'recent' => esc_html__('Recent Posts','alx'),
'popular' => esc_html__('Popular Posts','alx'),
'comments' => esc_html__('Recent Comments','alx'),
'tags' => esc_html__('Tags','alx')
);
$icons = array(
'recent' => 'fa fa-clock-o',
'popular' => 'fa fa-star',
'comments' => 'fa fa-comments-o',
'tags' => 'fa fa-tags'
);
$output = sprintf('<ul class="alx-tabs-nav group tab-count-%s">', $count);
foreach ( $tabs as $tab ) {
$output .= sprintf('<li class="alx-tab tab-%1$s"><a href="#tab-%2$s" title="%4$s"><i class="%3$s"></i><span>%4$s</span></a></li>',$tab, $tab . '-' . $this -> number, $icons[$tab], $titles[$tab]);
}
$output .= '</ul>';
return $output;
}
/* Widget
/* ------------------------------------ */
public function widget($args, $instance) {
extract( $args );
$defaults = $this -> alx_get_defaults();
$instance = wp_parse_args( (array) $instance, $defaults );
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
$output = $before_widget."\n";
if($title)
$output .= $before_title.$title.$after_title;
ob_start();
/* Set tabs-nav order & output it
/* ------------------------------------ */
$tabs = array();
$count = 0;
$order = array(
'recent' => $instance['order_recent'],
'popular' => $instance['order_popular'],
'comments' => $instance['order_comments'],
'tags' => $instance['order_tags']
);
asort($order);
foreach ( $order as $key => $value ) {
if ( $instance[$key.'_enable'] ) {
$tabs[] = $key;
$count++;
}
}
if ( $tabs && ($count > 1) ) { $output .= $this->_create_tabs($tabs,$count); }
?>
<div class="alx-tabs-container">
<?php if($instance['recent_enable']) { // Recent posts enabled? ?>
<?php $recent=new WP_Query(); ?>
<?php $recent->query('showposts='.absint($instance["recent_num"]).'&cat='.absint($instance["recent_cat_id"]).'&ignore_sticky_posts=1');?>
<ul id="tab-recent-<?php echo $this -> number ?>" class="alx-tab group <?php if($instance['recent_thumbs']) { echo 'thumbs-enabled'; } ?>">
<?php while ($recent->have_posts()): $recent->the_post(); ?>
<li>
<?php if($instance['recent_thumbs']) { // Thumbnails enabled? ?>
<div class="tab-item-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ): ?>
<?php the_post_thumbnail('alx-small'); ?>
<?php else: ?>
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/img/thumb-small.png" alt="<?php the_title_attribute(); ?>" />
<?php endif; ?>
<?php if ( has_post_format('video') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-play"></i></span>'; ?>
<?php if ( has_post_format('audio') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-volume-up"></i></span>'; ?>
<?php if ( is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-star"></i></span>'; ?>
</a>
</div>
<?php } ?>
<div class="tab-item-inner group">
<?php if($instance['tabs_category']) { ?><p class="tab-item-category"><?php the_category(' / '); ?></p><?php } ?>
<p class="tab-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></p>
<?php if($instance['tabs_date']) { ?><p class="tab-item-date"><?php the_time( get_option('date_format') ); ?></p><?php } ?>
</div>
</li>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</ul><!--/.alx-tab-->
<?php } ?>
<?php if($instance['popular_enable']) { // Popular posts enabled? ?>
<?php
$popular = new WP_Query( array(
'post_type' => array( 'post' ),
'showposts' => absint( $instance['popular_num'] ),
'cat' => absint( $instance['popular_cat_id'] ),
'ignore_sticky_posts' => true,
'orderby' => 'comment_count',
'order' => 'dsc',
'date_query' => array(
array(
'after' => esc_attr( $instance['popular_time'] ),
),
),
) );
?>
<ul id="tab-popular-<?php echo $this -> number ?>" class="alx-tab group <?php if($instance['popular_thumbs']) { echo 'thumbs-enabled'; } ?>">
<?php while ( $popular->have_posts() ): $popular->the_post(); ?>
<li>
<?php if($instance['popular_thumbs']) { // Thumbnails enabled? ?>
<div class="tab-item-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ): ?>
<?php the_post_thumbnail('alx-small'); ?>
<?php else: ?>
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-small.png" alt="<?php the_title_attribute(); ?>" />
<?php endif; ?>
<?php if ( has_post_format('video') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-play"></i></span>'; ?>
<?php if ( has_post_format('audio') && !is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-volume-up"></i></span>'; ?>
<?php if ( is_sticky() ) echo'<span class="thumb-icon small"><i class="fa fa-star"></i></span>'; ?>
</a>
</div>
<?php } ?>
<div class="tab-item-inner group">
<?php if($instance['tabs_category']) { ?><p class="tab-item-category"><?php the_category(' / '); ?></p><?php } ?>
<p class="tab-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></p>
<?php if($instance['tabs_date']) { ?><p class="tab-item-date"><?php the_time( get_option('date_format') ); ?></p><?php } ?>
</div>
</li>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</ul><!--/.alx-tab-->
<?php } ?>
<?php if($instance['comments_enable']) { // Recent comments enabled? ?>
<?php $comments = get_comments(array('number'=>absint( $instance["comments_num"] ),'status'=>'approve','post_status'=>'publish')); ?>
<ul id="tab-comments-<?php echo $this -> number ?>" class="alx-tab group <?php if($instance['comments_avatars']) { echo 'avatars-enabled'; } ?>">
<?php foreach ($comments as $comment): ?>
<li>
<?php if($instance['comments_avatars']) { // Avatars enabled? ?>
<div class="tab-item-avatar">
<a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>">
<?php echo get_avatar($comment->comment_author_email,$size='96'); ?>
</a>
</div>
<?php } ?>
<div class="tab-item-inner group">
<?php $str=explode(' ',get_comment_excerpt($comment->comment_ID)); $comment_excerpt=implode(' ',array_slice($str,0,11)); if(count($str) > 11 && substr($comment_excerpt,-1)!='.') $comment_excerpt.='...' ?>
<div class="tab-item-name"><?php echo esc_attr( $comment->comment_author ); ?> <?php esc_html_e('says:','alx'); ?></div>
<div class="tab-item-comment"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php echo esc_attr( $comment_excerpt ); ?></a></div>
</div>
</li>
<?php endforeach; ?>
</ul><!--/.alx-tab-->
<?php } ?>
<?php if($instance['tags_enable']) { // Tags enabled? ?>
<ul id="tab-tags-<?php echo $this -> number ?>" class="alx-tab group">
<li>
<?php wp_tag_cloud(); ?>
</li>
</ul><!--/.alx-tab-->
<?php } ?>
</div>
<?php
$output .= ob_get_clean();
$output .= $after_widget."\n";
echo $output;
}
/* Widget update
/* ------------------------------------ */
public function update($new,$old) {
$instance = $old;
$instance['title'] = sanitize_text_field($new['title']);
$instance['tabs_category'] = $new['tabs_category']?1:0;
$instance['tabs_date'] = $new['tabs_date']?1:0;
// Recent posts
$instance['recent_enable'] = $new['recent_enable']?1:0;
$instance['recent_thumbs'] = $new['recent_thumbs']?1:0;
$instance['recent_cat_id'] = absint($new['recent_cat_id']);
$instance['recent_num'] = absint($new['recent_num']);
// Popular posts
$instance['popular_enable'] = $new['popular_enable']?1:0;
$instance['popular_thumbs'] = $new['popular_thumbs']?1:0;
$instance['popular_cat_id'] = absint($new['popular_cat_id']);
$instance['popular_time'] = sanitize_text_field($new['popular_time']);
$instance['popular_num'] = absint($new['popular_num']);
// Recent comments
$instance['comments_enable'] = $new['comments_enable']?1:0;
$instance['comments_avatars'] = $new['comments_avatars']?1:0;
$instance['comments_num'] = absint($new['comments_num']);
// Tags
$instance['tags_enable'] = $new['tags_enable']?1:0;
// Order
$instance['order_recent'] = absint($new['order_recent']);
$instance['order_popular'] = absint($new['order_popular']);
$instance['order_comments'] = absint($new['order_comments']);
$instance['order_tags'] = absint($new['order_tags']);
return $instance;
}
/* Widget form
/* ------------------------------------ */
public function form($instance) {
// Default widget settings
$defaults = array(
'title' => '',
'tabs_category' => 1,
'tabs_date' => 1,
// Recent posts
'recent_enable' => 1,
'recent_thumbs' => 1,
'recent_cat_id' => '0',
'recent_num' => '5',
// Popular posts
'popular_enable' => 1,
'popular_thumbs' => 1,
'popular_cat_id' => '0',
'popular_time' => '0',
'popular_num' => '5',
// Recent comments
'comments_enable' => 1,
'comments_avatars' => 1,
'comments_num' => '5',
// Tags
'tags_enable' => 1,
// Order
'order_recent' => '1',
'order_popular' => '2',
'order_comments' => '3',
'order_tags' => '4',
);
$instance = wp_parse_args( (array) $instance, $defaults );
?>
<div class="alx-options-tabs">
<p>
<label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php esc_html_e( 'Title:', 'alx' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" />
</p>
<h4><?php esc_html_e( 'Recent Posts', 'alx' ); ?></h4>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('recent_enable') ); ?>" name="<?php echo esc_attr( $this->get_field_name('recent_enable') ); ?>" <?php checked( (bool) $instance["recent_enable"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('recent_enable') ); ?>"><?php esc_html_e( 'Enable recent posts', 'alx' ); ?></label>
</p>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('recent_thumbs') ); ?>" name="<?php echo esc_attr( $this->get_field_name('recent_thumbs') ); ?>" <?php checked( (bool) $instance["recent_thumbs"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('recent_thumbs') ); ?>"><?php esc_html_e( 'Show thumbnails', 'alx' ); ?></label>
</p>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("recent_num") ); ?>"><?php esc_html_e( 'Items to show', 'alx' ); ?></label>
<input style="width:20%;" id="<?php echo esc_attr( $this->get_field_id("recent_num") ); ?>" name="<?php echo esc_attr( $this->get_field_name("recent_num") ); ?>" type="text" value="<?php echo absint($instance["recent_num"]); ?>" size='3' />
</p>
<p>
<label style="width: 100%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("recent_cat_id") ); ?>"><?php esc_html_e( 'Category:', 'alx' ); ?></label>
<?php wp_dropdown_categories( array( 'name' => $this->get_field_name("recent_cat_id"), 'selected' => $instance["recent_cat_id"], 'show_option_all' => esc_html__('All','alx'), 'show_count' => true ) ); ?>
</p>
<hr>
<h4><?php esc_html_e( 'Most Popular', 'alx' ); ?></h4>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('popular_enable') ); ?>" name="<?php echo esc_attr( $this->get_field_name('popular_enable') ); ?>" <?php checked( (bool) $instance["popular_enable"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('popular_enable') ); ?>"><?php esc_html_e( 'Enable most popular posts', 'alx' ); ?></label>
</p>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('popular_thumbs') ); ?>" name="<?php echo esc_attr( $this->get_field_name('popular_thumbs') ); ?>" <?php checked( (bool) $instance["popular_thumbs"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('popular_thumbs') ); ?>"><?php esc_html_e( 'Show thumbnails', 'alx' ); ?></label>
</p>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("popular_num") ); ?>"><?php esc_html_e( 'Items to show', 'alx' ); ?></label>
<input style="width:20%;" id="<?php echo esc_attr( $this->get_field_id("popular_num") ); ?>" name="<?php echo esc_attr( $this->get_field_name("popular_num") ); ?>" type="text" value="<?php echo absint($instance["popular_num"]); ?>" size='3' />
</p>
<p>
<label style="width: 100%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("popular_cat_id") ); ?>"><?php esc_html_e( 'Category:', 'alx' ); ?></label>
<?php wp_dropdown_categories( array( 'name' => $this->get_field_name("popular_cat_id"), 'selected' => $instance["popular_cat_id"], 'show_option_all' => esc_html__('All','alx'), 'show_count' => true ) ); ?>
</p>
<p style="padding-top: 0.3em;">
<label style="width: 100%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("popular_time") ); ?>"><?php esc_html_e( 'Post with most comments from:', 'alx' ); ?></label>
<select style="width: 100%;" id="<?php echo esc_attr( $this->get_field_id("popular_time") ); ?>" name="<?php echo esc_attr( $this->get_field_name("popular_time") ); ?>">
<option value="0"<?php selected( $instance["popular_time"], "0" ); ?>><?php esc_html_e( 'All time', 'alx' ); ?></option>
<option value="1 year ago"<?php selected( $instance["popular_time"], "1 year ago" ); ?>><?php esc_html_e( 'This year', 'alx' ); ?></option>
<option value="1 month ago"<?php selected( $instance["popular_time"], "1 month ago" ); ?>><?php esc_html_e( 'This month', 'alx' ); ?></option>
<option value="1 week ago"<?php selected( $instance["popular_time"], "1 week ago" ); ?>><?php esc_html_e( 'This week', 'alx' ); ?></option>
<option value="1 day ago"<?php selected( $instance["popular_time"], "1 day ago" ); ?>><?php esc_html_e( 'Past 24 hours', 'alx' ); ?></option>
</select>
</p>
<hr>
<h4><?php esc_html_e( 'Recent Comments', 'alx' ); ?></h4>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('comments_enable') ); ?>" name="<?php echo esc_attr( $this->get_field_name('comments_enable') ); ?>" <?php checked( (bool) $instance["comments_enable"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('comments_enable') ); ?>"><?php esc_html_e( 'Enable recent comments', 'alx' ); ?></label>
</p>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('comments_avatars') ); ?>" name="<?php echo esc_attr( $this->get_field_name('comments_avatars') ); ?>" <?php checked( (bool) $instance["comments_avatars"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('comments_avatars') ); ?>"><?php esc_html_e( 'Show avatars', 'alx' ); ?></label>
</p>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("comments_num") ); ?>"><?php esc_html_e( 'Items to show', 'alx' ); ?></label>
<input style="width:20%;" id="<?php echo esc_attr( $this->get_field_id("comments_num") ); ?>" name="<?php echo esc_attr( $this->get_field_name("comments_num") ); ?>" type="text" value="<?php echo absint($instance["comments_num"]); ?>" size='3' />
</p>
<hr>
<h4><?php esc_html_e( 'Tags', 'alx' ); ?></h4>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('tags_enable') ); ?>" name="<?php echo esc_attr( $this->get_field_name('tags_enable') ); ?>" <?php checked( (bool) $instance["tags_enable"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('tags_enable') ); ?>"><?php esc_html_e( 'Enable tags', 'alx' ); ?></label>
</p>
<hr>
<h4><?php esc_html_e( 'Tab Order', 'alx' ); ?></h4>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("order_recent") ); ?>"><?php esc_html_e( 'Recent posts', 'alx' ); ?></label>
<input class="widefat" style="width:20%;" type="text" id="<?php echo esc_attr( $this->get_field_id("order_recent") ); ?>" name="<?php echo esc_attr( $this->get_field_name("order_recent") ); ?>" value="<?php echo esc_attr( $instance["order_recent"] ); ?>" />
</p>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("order_popular") ); ?>"><?php esc_html_e( 'Most popular', 'alx' ); ?></label>
<input class="widefat" style="width:20%;" type="text" id="<?php echo esc_attr( $this->get_field_id("order_popular") ); ?>" name="<?php echo esc_attr( $this->get_field_name("order_popular") ); ?>" value="<?php echo esc_attr( $instance["order_popular"] ); ?>" />
</p>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("order_comments") ); ?>"><?php esc_html_e( 'Recent comments', 'alx' ); ?></label>
<input class="widefat" style="width:20%;" type="text" id="<?php echo esc_attr( $this->get_field_id("order_comments") ); ?>" name="<?php echo esc_attr( $this->get_field_name("order_comments") ); ?>" value="<?php echo esc_attr( $instance["order_comments"] ); ?>" />
</p>
<p>
<label style="width: 55%; display: inline-block;" for="<?php echo esc_attr( $this->get_field_id("order_tags") ); ?>"><?php esc_html_e( 'Tags', 'alx' ); ?></label>
<input class="widefat" style="width:20%;" type="text" id="<?php echo esc_attr( $this->get_field_id("order_tags") ); ?>" name="<?php echo esc_attr( $this->get_field_name("order_tags") ); ?>" value="<?php echo esc_attr( $instance["order_tags"] ); ?>" />
</p>
<hr>
<h4><?php esc_html_e( 'Tab Info', 'alx' ); ?></h4>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('tabs_category') ); ?>" name="<?php echo esc_attr( $this->get_field_name('tabs_category') ); ?>" <?php checked( (bool) $instance["tabs_category"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('tabs_category') ); ?>"><?php esc_html_e( 'Show categories', 'alx' ); ?></label>
</p>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('tabs_date') ); ?>" name="<?php echo esc_attr( $this->get_field_name('tabs_date') ); ?>" <?php checked( (bool) $instance["tabs_date"], true ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id('tabs_date') ); ?>"><?php esc_html_e( 'Show dates', 'alx' ); ?></label>
</p>
<hr>
</div>
<?php
}
}
/* Register widget
/* ------------------------------------ */
if ( ! function_exists( 'alx_register_widget_tabs' ) ) {
function alx_register_widget_tabs() {
register_widget( 'AlxTabs' );
}
}
add_action( 'widgets_init', 'alx_register_widget_tabs' );

9
inc/widgets/widgets.css Normal file
View file

@ -0,0 +1,9 @@
/* widgets admin styling */
.widget .widget-inside .alx-options-tabs .postform,
.widget .widget-inside .alx-options-posts .postform { width: 100%; }
.widget .widget-inside .alx-options-tabs p,
.widget .widget-inside .alx-options-posts p { margin: 3px 0; }
.widget .widget-inside .alx-options-tabs hr,
.widget .widget-inside .alx-options-posts hr { margin: 20px 0 10px; }
.widget .widget-inside .alx-options-tabs h4,
.widget .widget-inside .alx-options-posts h4 { margin-bottom: 10px; }

View file

@ -1,129 +0,0 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Alx Extensions\n"
"POT-Creation-Date: 2019-01-14 22:02+0100\n"
"PO-Revision-Date: 2018-09-21 21:27+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"X-Poedit-KeywordsList: __;_e;_x;_ex;_n;_nx;_n_noop;_nx_noop;"
"translate_nooped_plural;number_format_i18n;date_i18n;esc_html__;esc_html_e;"
"esc_html_x;esc_attr__;esc_attr_e;esc_attr_x\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-SearchPath-0: .\n"
#: inc/options.php:17
msgid "Theme Extensions"
msgstr ""
#: inc/options.php:22
msgid "Social Share"
msgstr ""
#: inc/options.php:29
msgid "Enable Social Share"
msgstr ""
#: inc/options.php:37
msgid "Twitter Username"
msgstr ""
#: inc/options.php:38
msgid "Your @username will be added to share-tweets of your posts (optional)"
msgstr ""
#: inc/options.php:45
msgid "Image Upscale"
msgstr ""
#: inc/options.php:52
msgid "Enable Image Upscale"
msgstr ""
#: inc/options.php:59
msgid "Custom Sidebars"
msgstr ""
#: inc/options.php:66
msgid "Create Sidebars"
msgstr ""
#: inc/options.php:67
msgid "You must save and refresh the page to see your new sidebars."
msgstr ""
#: inc/options.php:68
msgid ""
"Make sure that you save and refresh the page if you can not see the sidebars "
"you have created."
msgstr ""
#: inc/options.php:72
msgid "sidebar"
msgstr ""
#: inc/options.php:79
msgid "Sidebar Title"
msgstr ""
#: inc/options.php:80
msgid "The widget box title"
msgstr ""
#: inc/options.php:85
msgid "Sidebar ID"
msgstr ""
#: inc/options.php:86
msgid "This ID must be unique"
msgstr ""
#: inc/post-formats.php:12
msgid "Format: Audio"
msgstr ""
#: inc/post-formats.php:21
msgid "Audio URL"
msgstr ""
#: inc/post-formats.php:30
msgid "Format: Video"
msgstr ""
#: inc/post-formats.php:39
msgid "Video URL"
msgstr ""
#: inc/share-footer.php:18 inc/share-footer.php:19 inc/share-footer.php:29
#: inc/share-footer.php:42 inc/share.php:18
msgid "Share"
msgstr ""
#: inc/share-footer.php:29
msgid "on Twitter"
msgstr ""
#: inc/share-footer.php:42
msgid "on Facebook"
msgstr ""
#: inc/share.php:19
msgid "Tweet"
msgstr ""
#: inc/share.php:20
msgid "Like"
msgstr ""
#: inc/share.php:21
msgid "Pin It"
msgstr ""
#: inc/share.php:22
msgid "Share on LinkedIn"
msgstr ""

294
languages/alx.pot Normal file
View file

@ -0,0 +1,294 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Alx Extensions\n"
"POT-Creation-Date: 2019-01-15 13:44+0100\n"
"PO-Revision-Date: 2018-09-21 21:27+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"X-Poedit-KeywordsList: __;_e;_x;_ex;_n;_nx;_n_noop;_nx_noop;"
"translate_nooped_plural;number_format_i18n;date_i18n;esc_html__;esc_html_e;"
"esc_html_x;esc_attr__;esc_attr_e;esc_attr_x\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-SearchPath-0: .\n"
#: inc/options.php:17
msgid "Theme Extensions"
msgstr ""
#: inc/options.php:22
msgid "Social Share"
msgstr ""
#: inc/options.php:29
msgid "Enable Social Share"
msgstr ""
#: inc/options.php:37
msgid "Twitter Username"
msgstr ""
#: inc/options.php:38
msgid "Your @username will be added to share-tweets of your posts (optional)"
msgstr ""
#: inc/options.php:45
msgid "Image Upscale"
msgstr ""
#: inc/options.php:52
msgid "Enable Image Upscale"
msgstr ""
#: inc/options.php:59
msgid "Custom Sidebars"
msgstr ""
#: inc/options.php:66
msgid "Create Sidebars"
msgstr ""
#: inc/options.php:67
msgid "You must save and refresh the page to see your new sidebars."
msgstr ""
#: inc/options.php:68
msgid ""
"Make sure that you save and refresh the page if you can not see the sidebars "
"you have created."
msgstr ""
#: inc/options.php:72
msgid "sidebar"
msgstr ""
#: inc/options.php:79
msgid "Sidebar Title"
msgstr ""
#: inc/options.php:80
msgid "The widget box title"
msgstr ""
#: inc/options.php:85
msgid "Sidebar ID"
msgstr ""
#: inc/options.php:86
msgid "This ID must be unique"
msgstr ""
#: inc/post-formats.php:12
msgid "Format: Audio"
msgstr ""
#: inc/post-formats.php:21
msgid "Audio URL"
msgstr ""
#: inc/post-formats.php:30
msgid "Format: Video"
msgstr ""
#: inc/post-formats.php:39
msgid "Video URL"
msgstr ""
#: inc/share-footer.php:18 inc/share-footer.php:19 inc/share-footer.php:29
#: inc/share-footer.php:42 inc/share.php:18
msgid "Share"
msgstr ""
#: inc/share-footer.php:29
msgid "on Twitter"
msgstr ""
#: inc/share-footer.php:42
msgid "on Facebook"
msgstr ""
#: inc/share.php:19
msgid "Tweet"
msgstr ""
#: inc/share.php:20
msgid "Like"
msgstr ""
#: inc/share.php:21
msgid "Pin It"
msgstr ""
#: inc/share.php:22
msgid "Share on LinkedIn"
msgstr ""
#: inc/widgets/alx-posts.php:19
msgid "Alx Posts"
msgstr ""
#: inc/widgets/alx-posts.php:19
msgid "Display posts from a category"
msgstr ""
#: inc/widgets/alx-posts.php:141 inc/widgets/alx-tabs.php:317
msgid "Title:"
msgstr ""
#: inc/widgets/alx-posts.php:145
msgid "List Posts"
msgstr ""
#: inc/widgets/alx-posts.php:149 inc/widgets/alx-tabs.php:329
#: inc/widgets/alx-tabs.php:349
msgid "Show thumbnails"
msgstr ""
#: inc/widgets/alx-posts.php:152 inc/widgets/alx-tabs.php:332
#: inc/widgets/alx-tabs.php:352 inc/widgets/alx-tabs.php:382
msgid "Items to show"
msgstr ""
#: inc/widgets/alx-posts.php:156 inc/widgets/alx-tabs.php:336
#: inc/widgets/alx-tabs.php:356
msgid "Category:"
msgstr ""
#: inc/widgets/alx-posts.php:157 inc/widgets/alx-tabs.php:337
#: inc/widgets/alx-tabs.php:357
msgid "All"
msgstr ""
#: inc/widgets/alx-posts.php:160
msgid "Order by:"
msgstr ""
#: inc/widgets/alx-posts.php:162
msgid "Most recent"
msgstr ""
#: inc/widgets/alx-posts.php:163
msgid "Most commented"
msgstr ""
#: inc/widgets/alx-posts.php:164
msgid "Random"
msgstr ""
#: inc/widgets/alx-posts.php:168
msgid "Posts from:"
msgstr ""
#: inc/widgets/alx-posts.php:170 inc/widgets/alx-tabs.php:362
msgid "All time"
msgstr ""
#: inc/widgets/alx-posts.php:171 inc/widgets/alx-tabs.php:363
msgid "This year"
msgstr ""
#: inc/widgets/alx-posts.php:172 inc/widgets/alx-tabs.php:364
msgid "This month"
msgstr ""
#: inc/widgets/alx-posts.php:173 inc/widgets/alx-tabs.php:365
msgid "This week"
msgstr ""
#: inc/widgets/alx-posts.php:174 inc/widgets/alx-tabs.php:366
msgid "Past 24 hours"
msgstr ""
#: inc/widgets/alx-posts.php:179
msgid "Post Info"
msgstr ""
#: inc/widgets/alx-posts.php:183 inc/widgets/alx-tabs.php:419
msgid "Show categories"
msgstr ""
#: inc/widgets/alx-posts.php:187 inc/widgets/alx-tabs.php:423
msgid "Show dates"
msgstr ""
#: inc/widgets/alx-tabs.php:19
msgid "Alx Tabs"
msgstr ""
#: inc/widgets/alx-tabs.php:19
msgid "List posts, comments, and/or tags with or without tabs."
msgstr ""
#: inc/widgets/alx-tabs.php:57 inc/widgets/alx-tabs.php:321
msgid "Recent Posts"
msgstr ""
#: inc/widgets/alx-tabs.php:58
msgid "Popular Posts"
msgstr ""
#: inc/widgets/alx-tabs.php:59 inc/widgets/alx-tabs.php:371
msgid "Recent Comments"
msgstr ""
#: inc/widgets/alx-tabs.php:60 inc/widgets/alx-tabs.php:387
#: inc/widgets/alx-tabs.php:410
msgid "Tags"
msgstr ""
#: inc/widgets/alx-tabs.php:221
msgid "says:"
msgstr ""
#: inc/widgets/alx-tabs.php:325
msgid "Enable recent posts"
msgstr ""
#: inc/widgets/alx-tabs.php:341
msgid "Most Popular"
msgstr ""
#: inc/widgets/alx-tabs.php:345
msgid "Enable most popular posts"
msgstr ""
#: inc/widgets/alx-tabs.php:360
msgid "Post with most comments from:"
msgstr ""
#: inc/widgets/alx-tabs.php:375
msgid "Enable recent comments"
msgstr ""
#: inc/widgets/alx-tabs.php:379
msgid "Show avatars"
msgstr ""
#: inc/widgets/alx-tabs.php:391
msgid "Enable tags"
msgstr ""
#: inc/widgets/alx-tabs.php:395
msgid "Tab Order"
msgstr ""
#: inc/widgets/alx-tabs.php:398
msgid "Recent posts"
msgstr ""
#: inc/widgets/alx-tabs.php:402
msgid "Most popular"
msgstr ""
#: inc/widgets/alx-tabs.php:406
msgid "Recent comments"
msgstr ""
#: inc/widgets/alx-tabs.php:415
msgid "Tab Info"
msgstr ""

View file

@ -8,11 +8,11 @@ Stable tag: 1.0.5
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Extends AlxMedia themes with additional features such as social share links, custom sidebars, thumbnail image upscale and post format meta boxes.
Extends AlxMedia themes with additional features such as social share links, custom sidebars, thumbnail image upscale and post format meta boxes. Also includes 2 flexible custom widgets, Alx Tabs and Alx Posts.
== Description ==
Extends AlxMedia themes with additional features such as social share links, custom sidebars, thumbnail image upscale and post format meta boxes.
Extends AlxMedia themes with additional features such as social share links, custom sidebars, thumbnail image upscale and post format meta boxes. Also includes 2 flexible custom widgets, Alx Tabs and Alx Posts.
== Changelog ==