Title: Fabian Todt's Replies | WordPress.org

---

# Fabian Todt

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

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

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/users/gaambo/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/gaambo/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Private Post Share] Plugin has an impact on Ajax search lite](https://wordpress.org/support/topic/plugin-has-an-impact-on-ajax-search-lite/)
 *  Plugin Author [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [7 months ago](https://wordpress.org/support/topic/plugin-has-an-impact-on-ajax-search-lite/#post-18764278)
 * Oh, you are right, my workaround was only half-baked: Since my function has a
   return type of `array` we still can’t return `null` as value. So the correct 
   workaround would be:
 *     ```wp-block-code
       // Fix for plugins returning null values. if( empty( $posts ) ) {    return [];}// NOTICE: Code below is untouched. // Only handle single views, don't handle not-found posts. if ( count( $posts ) !== 1 ) {        return $posts;    }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Private Post Share] Plugin has an impact on Ajax search lite](https://wordpress.org/support/topic/plugin-has-an-impact-on-ajax-search-lite/)
 *  Plugin Author [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [7 months ago](https://wordpress.org/support/topic/plugin-has-an-impact-on-ajax-search-lite/#post-18762242)
 * This seems to happen when a null-value is returned from any listener hooked into
   the `posts_results` filter. According to the [docs](https://developer.wordpress.org/reference/hooks/posts_results/)
   the `$posts` argument/return value can only be an (possible empty) array of `
   WP_Post` objects. Seems the plugin is passing a null value. I’m not using strong
   typing on the function parameters, because I’ve seen this when plugins return
   values with types that should not be allowed. But I guess the [usage of `count`](https://github.com/gaambo/sharable-password-protected-posts/blob/9720850942be56267e456cfc139235dd5feb81d8/includes/posts.php#L49)
   of course breaks when the value is not an array.
 * I could of course check for null values before using count. But that would be
   me fixing something that should not happen. The docs clearly state the type of
   the filter’s arguments/return value, and other plugins/code should not return
   a null value there. I would suggest talking to the devs.
 * **If you want a quick fix for your site:**
 * In my plugin inside `includes/posts.php` function `filter_posts_query` on line#
   49 change the following to the code beneath:
 *     ```wp-block-code
       if ( count( $posts ) !== 1 ) {  return $posts;}
       ```
   
 *     ```wp-block-code
       if ( empty($posts) || count( $posts ) !== 1 ) {  return $posts;}
       ```
   
 * **For the other plugin:**
 * The “Ajax Search Lite” plugin hooks into the same filter and returns the result
   of its custom `ASL_Query` object. This object’s `$posts` property is untyped 
   and could therefore be anything. The developer(s) should add code to catch non-
   array values and return an empty array instead (imho).
 * Hope that helps!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Private Post Share] URL stored in DB](https://wordpress.org/support/topic/url-stored-in-db-2/)
 *  Plugin Author [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [7 months, 3 weeks ago](https://wordpress.org/support/topic/url-stored-in-db-2/#post-18742389)
 * Hi, thank you for the feedback!
 * The URL is not stored in the database, but dynamically built. It’s just the post’s
   original permalink and the `_sppp_key` added as query string:
   [https://github.com/gaambo/sharable-password-protected-posts/blob/9720850942be56267e456cfc139235dd5feb81d8/includes/functions.php#L111](https://github.com/gaambo/sharable-password-protected-posts/blob/9720850942be56267e456cfc139235dd5feb81d8/includes/functions.php#L111)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Brevo - Email, SMS, Web Push, Chat, and more.] Web push enabled by default](https://wordpress.org/support/topic/web-push-enabled-by-default/)
 *  Thread Starter [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/web-push-enabled-by-default/#post-18452784)
 * My wish would be to disable the dashboard widget and the meta box, when the feature
   is not enabled. I understand those can be handy, when web push is used – but 
   that’s not the case. I can hide the widget and meta box manually (for every user)
   or write code to disable them, but still.
 * You’re right, it does not “affect core website functionality”, but it massively
   clutters the wp-admin experience on every screen for a feature that is not enabled.
 * Thank you for the quick update though!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Brevo - Email, SMS, Web Push, Chat, and more.] Web push enabled by default](https://wordpress.org/support/topic/web-push-enabled-by-default/)
 *  Thread Starter [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/web-push-enabled-by-default/#post-18452490)
 * I’ve updated the plugin to 3.2.1:
    - ⚠️ WP Admin Bar item is still visible by default
    - ✅ Can be disabled by going to Web Puh settings and clicking “hide wp admin
      bar item”.
    - **Imho this should be opt-in and hidden by default. **
    - ⚠️I can only “activate” web push in setings but not disable the complete functionality.
    - ⚠️Brevo web push meta box is **visible by default** on all content pages in**
      high** priority on side. Please remove this.
    - ✅Yoast SEO Metaboxes and primary term functionality seem to work correctly
      again.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Brevo - Email, SMS, Web Push, Chat, and more.] Web push enabled by default](https://wordpress.org/support/topic/web-push-enabled-by-default/)
 *  Thread Starter [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/web-push-enabled-by-default/#post-18451820)
 * I also don’t see a new version of the plugin for updating or on the repository
   page – still says 3.2.0 from 1 week ago is the newest one.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] New payments admin menu entry? What for?](https://wordpress.org/support/topic/new-payments-admin-menu-entry-what-for/)
 *  [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/new-payments-admin-menu-entry-what-for/#post-18161078)
 * I can only agree with OP here.
 * I also found this Github issue: [https://github.com/woocommerce/woocommerce/issues/39668](https://github.com/woocommerce/woocommerce/issues/39668)
 * It was closed, allthough the menu item is still there. But at least it contains
   code snippets to remove it.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Good Slider] Cover block width not working properly](https://wordpress.org/support/topic/cover-block-width-not-working-properly/)
 *  Plugin Author [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cover-block-width-not-working-properly/#post-18104236)
 * I understand, thank you for the feedback! I looked into it and overlay UI is 
   kind of complex and something I don’t want to implement in the custom block myself.
 * I will have a look into better supporting the cover block inside the slider. 
   As a quick workaround, you can put a cover block inside a slide and apply the
   following CSS in your (child) theme/custom CSS in site editor:
 *     ```wp-block-code
       .wp-block-good-slider .wp-block-good-slider__slide > .wp-block-cover {    width: 100%;    align-self: stretch;}
       ```
   
 * This will make a cover block stretch the full width/height of your slide. I have
   not tested this extensively. But in a quick test it worked well enough.
 * I’ve also opened a GitHub issue [here](https://github.com/goodwp/good-slider/issues/4)
   and [here](https://github.com/goodwp/good-slider/issues/5) to track this. But
   I can’t promise any timeline atm. PRs are welcome though 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Good Slider] Example extending functionality with php](https://wordpress.org/support/topic/example-extending-functionality-with-php/)
 *  Plugin Author [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/example-extending-functionality-with-php/#post-18102075)
 * Hi, 
   I’ve added another example which uses the swiper options filter here: [https://github.com/goodwp/good-slider/blob/main/examples/filters.php](https://github.com/goodwp/good-slider/blob/main/examples/filters.php)
   and also added a notice to the FAQs in the readme.
    -  This reply was modified 1 year, 8 months ago by [Fabian Todt](https://wordpress.org/support/users/gaambo/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Good Slider] Cover block width not working properly](https://wordpress.org/support/topic/cover-block-width-not-working-properly/)
 *  Plugin Author [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/cover-block-width-not-working-properly/#post-18102066)
 * I can confirm this in a quick test. The slide block does not support the align/
   alignWide block support because (if I remember correctly) it somehow messed with
   swiper styles.
 * But I tried to make the slide block work similar to the cover – it has most of
   the same block supports: background color, background image, spacing, dimensions,
   content position etc. Is there something you are missing?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [block.json selectors support](https://wordpress.org/support/topic/block-json-selectors-support/)
 *  Thread Starter [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/block-json-selectors-support/#post-17391145)
 * > You have specified several selectors
 * The code block above shows two “selectors” keys, because that were the two variants
   I tried. The first one directly sets one selector for the whole “typography” 
   block support, the second one sets a root selector for the typography block-support
   and a special selector for the fontSize “subfeature” (as it’s called in the docs).
 * I’ve just tried it with Gutenberg 17.6.0 and also disabled Gutenberg and tried
   it again. None of the two ways above worked.
 * I also don’t see any code inside the block support apply functions that would
   use the selectors. That’s why I thought, maybe it’s just for global styles but
   not for single block instances?
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Difference between useEntityProp and getEditedPostAttribute](https://wordpress.org/support/topic/difference-between-useentityprop-and-geteditedpostattribute/)
 *  Thread Starter [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/difference-between-useentityprop-and-geteditedpostattribute/#post-16466158)
 * Okay, thank you. But doesn’t the doc for `getEditedPostAttribute` “unsaved edit
   if one exists” suggest, that also unsaved edits will be returned?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[ACF Content Analysis for Yoast SEO] Text length: The text contains 0 words.](https://wordpress.org/support/topic/text-length-the-text-contains-0-words-2/)
 *  [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/text-length-the-text-contains-0-words-2/page/2/#post-13437555)
 * See this [GitHub issue](https://github.com/Yoast/yoast-acf-analysis/issues/272)–
   seems to be connected to using classic editor (which I am because I use it for
   flexible content fields). I remember there was a similar issue a while back.
   
   In the GitHub issue there’s also a code snippet for a workaround via functions.
   php.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PublishPress Revisions: Duplicate Posts, Submit, Approve and Schedule Content Changes] Wrong Thumbnail in Preview](https://wordpress.org/support/topic/wrong-thumbnail-in-preview/)
 *  Thread Starter [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wrong-thumbnail-in-preview/#post-12975898)
 * Yep, previews are working and showing the correct thumbnail. Thank you for the
   fast response.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Frontend Post WordPress Plugin - AccessPress Anonymous Post] Undefined Function is_user_logged_in](https://wordpress.org/support/topic/undefined-function-is_user_logged_in/)
 *  Thread Starter [Fabian Todt](https://wordpress.org/support/users/gaambo/)
 * (@gaambo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-function-is_user_logged_in/#post-12953530)
 * Thanks for your reply.
    I can’t – I only tested the update locally before deploying
   it to the live site. The error log was just a normal fatal error that the function`
   is_user_logged_in` called in `restrict_media_library` is not defined.
 * But I think I explained the problem well:
    This plugin calls `is_user_logged_in`
   which is ([according to documentation](https://developer.wordpress.org/reference/functions/is_user_logged_in/))
   a pluggable function and isn’t ensured to be loaded when you call it too early.
   Since this plugin calls it directly in a hook (`pre_get_posts`) and it’s not 
   completely sure when this hook is called (because it get’s called in **every**
   WP Query not only in the main query) it should check if the function exists. 
   Because some plugins (like the mentioned Broken Link Checker) make a WP Query**
   before** this pluggable function is included. Wheather that is correct behaviour
   of these plugins (or any other code which does it) to make a query before init
   is not important imho, because they do it (and I’ve seen it elsewhere as well).
   Therefore a quick fix to be compatible with any plugin which does it **and** 
   adhere to the documentation I encourage and ask you to wrap the call in a `function_exists`
   conditional – or as an alternative check if the current query is even the right
   query the plugin is after (as I see it’s only meant for media queries).

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/users/gaambo/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/gaambo/replies/page/2/?output_format=md)