WordPress.org

Ready to get started?Download WordPress

Forums

Cyclone Slider
List of gallery ids (2 posts)

  1. miguelsaddress
    Member
    Posted 1 year ago #

    Hello, nice plugin.
    Im authoring a plugin to insert a tinyMCE button in the editor which is displaying a select box to choose an existing cycloneslider gallery ... but I am not able to make a query to select the existing gallery ids...

    any help?

    thank you so much in advance!

    http://wordpress.org/extend/plugins/cyclone-slider/

  2. miguelsaddress
    Member
    Posted 1 year ago #

    Hello!

    My brain had a bad day yesterday ^_^I found out by myself what i wanted, so i post it:

    $sql = "SELECT distinct post_name FROM {$wpdb->posts} WHERE ID IN (
    		SELECT distinct post_id FROM {$wpdb->postmeta} WHERE meta_key = '_cycloneslider_settings' ORDER BY post_id
    		)";
    	$rows = $wpdb->get_results( $sql );
    
    	$opt = "<select id='tinymce-slider-id_select'>";
    	$opt .= "<option value='none'>-- Selecciona --</option>";
    
    	foreach ($rows as $r) {
    		$opt .= "<option value='{$r->post_name}'>{$r->post_name}</option>";
    	}
    	$opt .= "</select>";

    Just in case it helps someone :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic