Created
August 11, 2021 06:27
-
-
Save kallookoo/6097aac13a5386174405277164204775 to your computer and use it in GitHub Desktop.
Obtener las imagenes de responsive slider gallery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Obtener las imagenes de responsive slider gallery | |
* Author: Sergio (kallookoo) | |
* Author URI: https://dsergio.com | |
* | |
* @package ORSG | |
*/ | |
defined( 'ABSPATH' ) || exit; | |
add_action( | |
'current_screen', | |
function ( $screen ) { | |
if ( 'edit-responsive_slider' === $screen->id ) { | |
add_action( | |
'admin_notices', | |
function() { | |
$slideid = ( isset( $_POST['orsg'] ) ? intval( $_POST['orsg'] ) : '' ); | |
?> | |
<div class="notice"> | |
<p>Introducir el id del schortcode para obtener todas las imagenes.</p> | |
<form method="POST"> | |
<input type="text" name="orsg" value="<?php echo esc_attr( $slideid ); ?>"> | |
<?php submit_button( 'Obtener', 'primary', 'submit', false ); ?> | |
</form> | |
<?php | |
if ( $slideid ) : | |
$slideids = unserialize( | |
base64_decode( | |
get_post_meta( $slideid, "awl_slider_settings_{$slideid}", true ) | |
) | |
); | |
$slideids = ( isset( $slideids['slide-ids'] ) ? $slideids['slide-ids'] : '' ); | |
$slideids = ( is_array( $slideids ) ? implode( ',', $slideids ) : '' ); | |
?> | |
<p><pre><code>[gallery ids="<?php echo esc_attr( $slideids ); ?>"]</code></pre></p> | |
<?php endif; ?> | |
</div> | |
<?php | |
unset( $slideid, $slideids ); | |
} | |
); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment