Title: devtotte's Replies | WordPress.org

---

# devtotte

  [  ](https://wordpress.org/support/users/devtotte/)

 *   [Profile](https://wordpress.org/support/users/devtotte/)
 *   [Topics Started](https://wordpress.org/support/users/devtotte/topics/)
 *   [Replies Created](https://wordpress.org/support/users/devtotte/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/devtotte/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/devtotte/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/devtotte/engagements/)
 *   [Favorites](https://wordpress.org/support/users/devtotte/favorites/)

 Search replies:

## Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Max Mega Menu] Mega menu lost css in secon language](https://wordpress.org/support/topic/mega-menu-lost-css-in-secon-language/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/mega-menu-lost-css-in-secon-language/#post-14784169)
 * found the solution
    -  This reply was modified 4 years, 11 months ago by [devtotte](https://wordpress.org/support/users/devtotte/).
    -  This reply was modified 4 years, 11 months ago by [devtotte](https://wordpress.org/support/users/devtotte/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/page/2/#post-13443289)
 * I successfully got the other images excluded from the all images query but if
   there is a empty folder and filter those images, it return all images uploaded
   to wp because the
    `'post__in' => $wpdb->get_col("SELECT attachment_id FROM ".
   $wpdb->prefix . "fbv_attachment_folder WHERE folder_id = $all_folders_ids")` 
   argument is then empty and the deafault setting in wp is that the query returns
   all of that type, in this case ‘attachment’.
 * Havent found a way to fix this yet.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/#post-13442672)
 * Yes, that worked, but maybe its better to have the notice or try to find away
   to do the `wpdb->prepare` request properly.
 * I just noticed that the filter function returns all images uploaded to wordpress
   when getting all images. How can i exclude all images that are not added to a
   folder? I have this in my arguments and folder_id should be all folders. I tried
   this but it still return all images uploaded to wp.
    `'post__in' => $wpdb->get_col("
   SELECT attachment_id FROM " . $wpdb->prefix . "fbv_attachment_folder WHERE folder_id
   = 1" OR "2" OR "3" OR "4" OR "5")` Also tried this but since $all_folders_ids
   is an array it didnt work.
 *     ```
       $query = "SELECT attachment_id FROM {$wpdb->prefix}fbv_attachment_folder";
       $all_folders_ids = $wpdb->get_col($query);
       $image_args = array(
       'post_type' => 'attachment',
                   'post_status' => 'inherit',
                   'posts_per_page' => -1,
                   'post__in' => $wpdb->get_col("SELECT attachment_id FROM " . $wpdb->prefix . "fbv_attachment_folder WHERE folder_id = $all_folders_ids")
               );
       ```
   
 * Any suggestions on how i can exclude all other images?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/#post-13437755)
 * Thanks! `global $wpdb;` was missing and now it works.
 * The WP_debug is on and prints a couple of notices:
    `Notice: wpdb::prepare was
   called incorrectly. The query argument of wpdb::prepare() must have a placeholder.`
 * and
 * `Notice: Undefined offset: 0` in wp-includes/wp-db.php on line 1319
 * Since they are notices they’re probably not that important and the code works
   now.
 * Thank you!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/#post-13437066)
 * Ajax is sending the correct folder_id to the filtering function and i can echo
   the correct folder_id on the page but there is something wrong in the the query
   because it returns all the images and not only the images in that folder.
    So
   this line probably is the problem: `'post__in' => $wpdb->get_col("SELECT attachment_id
   FROM " . $wpdb->prefix . "fbv_attachment_folder WHERE folder_id = $folder_id")`
 * That probably also is the reason tor the 500 internal server error in the js 
   console.
 * $folder_id is the folder id that ajax sends to the filtering function.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/#post-13436926)
 * Hi,
 * Thanks for the suggestion. I tried it out and get a couple o notices and the 
   filtering isn’t working.
 * The buttons and the first query works but gives also a “Notice: wpdb::prepare
   was called incorrectly. The query argument of wpdb::prepare() must have a placeholder.”
   and “Notice: Undefined offset: 0 in wp-includes/wp-db.php on line 1319”. These
   notices appear 2 times, one for the filtering buttons and one for the image query.
 * When clicking on a filtering button i get “POST localhost…wp-admin/admin-ajax.
   php 500 (Internal Server Error)” in js console.
 * Can you help me how to send the ajax data to the filtering function?
 * This was the old ajax when i was querying with a taxonomy id
 *     ```
       jQuery.ajax({
       			type: 'POST',
       			url: ajaxurl,
       			data: {"action": "load-filter", term: termID },
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/#post-13406994)
 * for the category buttons:
 *     ```
       $taxonomy = get_terms('nt_wmc_folder');
   
            $args = array(
               'post_type' => 'attachment',
               'post_status' => 'inherit',
               'posts_per_page' => -1,
   
               );
       ?>
                   <div class="row">
                       <div class="col-sm-12">
   
                       	<ul class="image-filter">
   
                               <li class="filter-btn cat-0">
                                   <a href="#imagebank" onclick="cat_ajax_get(0)" class="ajax">Kaikki</a>
                               </li>
   
                               <?php foreach ($taxonomy as $tax) :
                                       $tax_id = $tax->term_id;
                                           if ($tax_id !== 1) : ?>
   
                                           <li class="filter-btn cat-<?php echo $tax->term_id ?>">
                                               <a href="#imagebank" onclick="cat_ajax_get('<?php echo $tax->term_id; ?>')" class="ajax"><?php echo $tax->name; ?></a>
                                           </li>
   
                                           <?php endif; ?>
   
                                <?php endforeach; ?>
   
                       	</ul>
   
                       </div>
                   </div>
       ```
   
 * Then just a basic query to display images:
 *     ```
       $image_taxonomy = 'nt_wmc_folder';
   
           $taxonomy_terms = get_terms( $image_taxonomy, array(
               'hide_empty' => 0,
               'fields' => 'ids'
           ) );
   
           $image_args = array(
                   'post_type' => 'attachment',
                   'post_status' => 'inherit',
                   'posts_per_page' => -1,
                   'orderby' => 'rand',
                   'tax_query' => array(
                      array(
                          'taxonomy' => $image_taxonomy,
                          'field'    => 'id',
                          'terms'    => $taxonomy_terms
                      ),
                   ),
               );
   
           ?>
   
       <div class="row">
           <div class="col-sm-12">
   
               <ul class="masonry image-list" id="imagebank">
   
               <?php
   
                   $all_images = new WP_Query($image_args);
   
                       if ( $all_images->have_posts() ) : while ( $all_images->have_posts() ) : $all_images->the_post();
                           ?>
   
                       <li class="image-item">
       ```
   
 * The filtering function (uses ajax also):
 *     ```
       function prefix_load_cat_images() {
   
           $tax_id = $_POST[ 'term' ];
           $taxonomy_terms = get_terms( $image_taxonomy, array(
               'hide_empty' => 0,
               'fields' => 'ids'
           ) );
               if ($tax_id != 0) {
                   $image_args = array(
                           'post_type' => 'attachment',
                           'post_mime_type' =>'image',
                           'post_status' => 'inherit',
                           'posts_per_page' => -1,
                           // 'category__not_in' => array( 1 ),
                           'tax_query' => array(
                               array(
                                   'taxonomy' => 'nt_wmc_folder',
                                   'field'    => 'id',
                                   'terms'    => $tax_id,
                                   'operator' => 'IN'
                               )
                           )
                   );
               } else {
                   $image_args = array(
                           'post_type' => 'attachment',
                           'post_status' => 'inherit',
                           'posts_per_page' => -1,
                           'tax_query' => array(
                              array(
                                  'taxonomy' => 'nt_wmc_folder',
                                  'field'    => 'id',
                                  'terms'    => $taxonomy_terms
                              ),
                           ),
                       );
               }
       ```
   
 * cant put the whole code here. its too long.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/#post-13406794)
 * Hi,
 * Thanks for the answer.
 * That did not help me solving the problem.
 * I need to query all the images and display them. Then i have a button for each
   category (used the taxonomies until now) to filter images based on which category
   they belong to. Is this possible after the update?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[FileBird - WordPress Media Library Folders & File Manager] filebird taxonomies cant be found](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/filebird-taxonomies-cant-be-found/#post-13406568)
 * Hi,
 * I have a similar problem. I have created a gallery with a filtering system but
   now it gives me an error when trying to get the terms: object(WP_Error)#1865 (
   2) { [“errors”]=> array(1) { [“invalid_taxonomy”]=> array(1)
 * Has the taxonomy name changed (if so, to what?) or do i need to build this system
   in another way from scratch?
 * Thanks!
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Hide delete site](https://wordpress.org/support/topic/hide-delete-site/)
 *  Thread Starter [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/hide-delete-site/#post-12144337)
 * Thanks for the reply Joy. Im aware of that plugin but im trying to avoid installing
   more plugins.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[RSS Feed Retriever] Version 1.5.0 broke my feed page](https://wordpress.org/support/topic/version-1-5-0-broke-my-feed-page/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/version-1-5-0-broke-my-feed-page/#post-11860114)
 * This update broke my feed to. I have a endless looping feed done with marquee.
   js. Now the marquee code does not work at all and the custom css that i had broke.
 * What is the “wprss_ajax” div doing? That seems to be the cause to my problems
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[EU Cookie Law for GDPR/CCPA] new cookie law requirement YES/NO selection](https://wordpress.org/support/topic/new-cookie-law-requirement-yes-no-selection/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/new-cookie-law-requirement-yes-no-selection/page/2/#post-10311709)
 * [@rfmcomposer](https://wordpress.org/support/users/rfmcomposer/)
    how do you 
   remove the cookies if the visitor decides to revoke the consent? i think you 
   have to disable google analytics, even if it is anonymized, if the user revokes
   the cookie consent. do you have a solution for this?
 * or do [@milmor](https://wordpress.org/support/users/milmor/) have any suggestions.
   the [cookie-control] shortcode removes only the ‘eucookielaw’ cookie.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[EU Cookie Law for GDPR/CCPA] Block scripts if cookies are not accepted](https://wordpress.org/support/topic/block-scripts-if-cookies-are-not-accepted/)
 *  [devtotte](https://wordpress.org/support/users/devtotte/)
 * (@devtotte)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/block-scripts-if-cookies-are-not-accepted/#post-10306814)
 * take a look at what [@rfmcomposer](https://wordpress.org/support/users/rfmcomposer/)
   is doing.
 * [https://wordpress.org/support/topic/new-cookie-law-requirement-yes-no-selection/](https://wordpress.org/support/topic/new-cookie-law-requirement-yes-no-selection/)
 * [https://wordpress.org/support/topic/auto-block-doesnt-work-fix/](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/)
 * Also if you check the “Auto block” checkbox all scripts should be blocked on 
   page load.

Viewing 13 replies - 1 through 13 (of 13 total)