updated plugin AudioIgniter version 2.0.4
This commit is contained in:
@ -5,9 +5,10 @@
|
||||
* Description: AudioIgniter lets you create music playlists and embed them in your WordPress posts, pages or custom post types and serve your audio content in style!
|
||||
* Author: The CSSIgniter Team
|
||||
* Author URI: https://www.cssigniter.com
|
||||
* Version: 2.0.1
|
||||
* License: GPLv2 or later
|
||||
* Version: 2.0.4
|
||||
* Text Domain: audioigniter
|
||||
* Domain Path: languages
|
||||
* Domain Path: /languages
|
||||
*
|
||||
* AudioIgniter is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -129,10 +130,6 @@ class AudioIgniter {
|
||||
self::$plugin_url = plugin_dir_url( __FILE__ );
|
||||
self::$plugin_path = plugin_dir_path( __FILE__ );
|
||||
|
||||
add_action( 'init', function() {
|
||||
load_plugin_textdomain( 'audioigniter', false, dirname( self::plugin_basename() ) . '/languages' );
|
||||
} );
|
||||
|
||||
require_once untrailingslashit( $this->plugin_path() ) . '/inc/class-audioigniter-sanitizer.php';
|
||||
$this->sanitizer = new AudioIgniter_Sanitizer();
|
||||
|
||||
@ -223,7 +220,7 @@ class AudioIgniter {
|
||||
'previous' => esc_html__( 'Previous track', 'audioigniter' ),
|
||||
'next' => esc_html__( 'Next track', 'audioigniter' ),
|
||||
'toggle_list_repeat' => esc_html__( 'Toggle track listing repeat', 'audioigniter' ),
|
||||
'toggle_track_repeat' => esc_html__( 'Toggle track repeat' ),
|
||||
'toggle_track_repeat' => esc_html__( 'Toggle track repeat', 'audioigniter' ),
|
||||
'toggle_list_visible' => esc_html__( 'Toggle track listing visibility', 'audioigniter' ),
|
||||
'buy_track' => esc_html__( 'Buy this track', 'audioigniter' ),
|
||||
'download_track' => esc_html__( 'Download this track', 'audioigniter' ),
|
||||
@ -1211,7 +1208,7 @@ class AudioIgniter {
|
||||
'class' => '',
|
||||
), $atts, $tag );
|
||||
|
||||
$id = intval( $atts['id'] );
|
||||
$id = (int) $atts['id'];
|
||||
$class_name = $atts['class'];
|
||||
|
||||
if ( ! $this->is_playlist( $id ) ) {
|
||||
@ -1220,6 +1217,13 @@ class AudioIgniter {
|
||||
|
||||
$post = get_post( $id );
|
||||
|
||||
if ( $post->post_status == 'trash' ||
|
||||
( ! is_user_logged_in() && 'publish' !== $post->post_status ) ||
|
||||
( is_user_logged_in() && ! current_user_can( 'read_post', $id ) ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
$params = apply_filters( 'audioigniter_shortcode_data_attributes_array', $this->get_playlist_data_attributes_array( $id ), $id, $post, $atts );
|
||||
$params = array_filter( $params, array( $this->sanitizer, 'array_filter_empty_null' ) );
|
||||
$params = $this->sanitizer->html_data_attributes_array( $params );
|
||||
@ -1269,12 +1273,17 @@ class AudioIgniter {
|
||||
return;
|
||||
}
|
||||
|
||||
$playlist_id = intval( $playlist_id );
|
||||
$playlist_id = (int) $playlist_id;
|
||||
$post = get_post( $playlist_id );
|
||||
|
||||
if ( empty( $post ) || $post->post_type !== $this->post_type ) {
|
||||
wp_send_json_error( __( "ID doesn't match a playlist", 'audioigniter' ) );
|
||||
}
|
||||
if ( ( ! is_user_logged_in() && 'publish' !== $post->post_status ) ||
|
||||
( is_user_logged_in() && ! current_user_can( 'read_post', $playlist_id ) )
|
||||
) {
|
||||
wp_send_json_error( __( 'Sorry, you are not allowed to access this playlist.', 'audioigniter' ) );
|
||||
}
|
||||
|
||||
$response = array();
|
||||
$tracks = $this->get_post_meta( $playlist_id, '_audioigniter_tracks', array() );
|
||||
|
||||
Reference in New Issue
Block a user