Title: phpbot's Replies | WordPress.org

---

# phpbot

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

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

 Search replies:

## Forum Replies Created

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

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Custom Fields: Extended] User email validation broken](https://wordpress.org/support/topic/user-email-validation-broken/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/user-email-validation-broken/#post-16251280)
 * Got it, thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Custom Fields: Extended] User email validation broken](https://wordpress.org/support/topic/user-email-validation-broken/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/user-email-validation-broken/#post-16247017)
 * Ah okay got it.
 * In this case we are using a GET param of the viewed page `?foo[user_id]=123`,
   which translated into ACFE like:
 * `{request:foo:user_id}`
 * I can confirm it is working, since saving and loading works without any problems.
 * Only the email validation is failing, both for create and update forms.
 * Best
    -  This reply was modified 3 years, 5 months ago by [phpbot](https://wordpress.org/support/users/phpbot/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Custom Fields: Extended] User email validation broken](https://wordpress.org/support/topic/user-email-validation-broken/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/user-email-validation-broken/#post-16245319)
 * Hey
 * Thanks a lot for the fast response
 * Can you please share a screenshot which part of the UI / which setting you are
   talking about?
 * Searching for a target UI element, but can’t find one. 🙈
 * Here is the first settings screen, if this already includes what you asked for?
 * [https://gofile.io/d/ps1VB4](https://gofile.io/d/ps1VB4)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Jetpack: E_ERROR – line 98 of the file /plugins/jetpack/src/class-tracking.php](https://wordpress.org/support/topic/jetpack-e_error-line-98-of-the-file-plugins-jetpack-src-class-tracking-php/)
 *  [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/jetpack-e_error-line-98-of-the-file-plugins-jetpack-src-class-tracking-php/#post-15688677)
 * Exact same error here, what can we do?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Download Monitor] WooCommerce integration (extra product info/sheets)](https://wordpress.org/support/topic/woocommerce-integration-extra-product-info-sheets/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years ago](https://wordpress.org/support/topic/woocommerce-integration-extra-product-info-sheets/#post-15608721)
 * [@cristianraiber-1](https://wordpress.org/support/users/cristianraiber-1/) thanks
   for your answer.
 * Our use case is to offer product data as downloadable PDF for each product, so
   customers can download additional product related data as PDFs.
 * For example, offering product sheet downloads in a B2B WooCommerce store:
 * >  In some industry, it’s also a data sheet / product marketing sheet. It’s basically
   > a one page document the 3rd party can take it with them to show it to the other
   > folks.
 * [https://www.designernews.co/stories/15101-what-is-a-product](https://www.designernews.co/stories/15101-what-is-a-product)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro] List recent back in stock products](https://wordpress.org/support/topic/list-recent-back-in-stock-products/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/list-recent-back-in-stock-products/#post-15542655)
 * Here is a useful answer about sorting based on custom metadata: [https://wordpress.stackexchange.com/a/109853/218274](https://wordpress.stackexchange.com/a/109853/218274)
 * For full details, check out: [https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters)
 * I guess you are looking for:
 * `'orderby' => 'meta_value'`
    -  This reply was modified 4 years, 1 month ago by [phpbot](https://wordpress.org/support/users/phpbot/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro] List recent back in stock products](https://wordpress.org/support/topic/list-recent-back-in-stock-products/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/list-recent-back-in-stock-products/#post-15520568)
 * You can add sorting by the custom meta field (orderby), to get latest/oldest 
   products. Here is how to implement in the Query: [https://stackoverflow.com/a/50937314/13765033](https://stackoverflow.com/a/50937314/13765033)
 * The class method, which returns the shortcode contents itself uses the WooCommerce
   built in `[products]` shortcode, which supports a variety of attributes, you 
   can go ahead and extend the method to dynamically set these attributes to the
   final `do_shortcode()` call. This way, you will be able to use all WooCommerce
   built-in attributes on the custom shortcode.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro] List recent back in stock products](https://wordpress.org/support/topic/list-recent-back-in-stock-products/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/list-recent-back-in-stock-products/#post-15519771)
 * [@corentinco](https://wordpress.org/support/users/corentinco/) I can confirm 
   the code is working for me.
 * Note that you have to be running on a minimum PHP Version of 8.0.0 to get things
   running smoothly (as noted in the plugin header comment).
 * If you are on PHP 8 and are facing an error message, feel free to post it here,
   so we can take a look into it.
    -  This reply was modified 4 years, 1 month ago by [phpbot](https://wordpress.org/support/users/phpbot/).
    -  This reply was modified 4 years, 1 month ago by [phpbot](https://wordpress.org/support/users/phpbot/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro] List recent back in stock products](https://wordpress.org/support/topic/list-recent-back-in-stock-products/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/list-recent-back-in-stock-products/#post-15500026)
 * Thanks, hooking into `cwginstock_trigger_status` and saving the back in stock
   timestamp to product meta to be able to select products that are in stock and
   got in stock in the last X days works fine.
 * For everybody interested, here is a base version for a plugin doing the job:
 *     ```
       <?php
   
       /**
        * Plugin Name: WooCommerce back in stock since
        * Requires PHP: 8.0
        * Version: 1.0.0
        */
   
       class PhpBotWcBackInStockSince
       {
   
           private $metaKey = '_php_bot_wc_back_in_stock_since';
   
           /**
            * constructor
            */
           public function __construct()
           {
               add_action(
                   hook_name: 'cwginstock_trigger_status',
                   callback: [$this, 'saveSince'],
                   accepted_args: 3,
               );
   
               add_shortcode(
                   tag: 'php_bot_wc_back_in_stock_since',
                   callback: [$this, 'shortcode'],
               );
           }
   
           function saveSince($id, $stockstatus, $obj)
           {
               update_post_meta($id, $this->metaKey, current_time('mysql'));
           }
   
           /**
            * [php_bot_wc_back_in_stock_since days="7"]
            */
           function shortcode(array $atts): string
           {
               $atts = shortcode_atts(
                   array(
                       'days' => 7,
                   ),
                   $atts,
                   'php_bot_wc_back_in_stock_since'
               );
   
               $objs = $this->getProductsInStockSince($atts['days']);
   
               if (empty($objs)) {
                   return '';
               }
   
               $ids = array_map(
                   function ($obj) {
   
                       if ($obj->post_type === 'product_variation') {
                           return $obj->post_parent;
                       }
   
                       return $obj->ID;
                   },
                   $objs
               );
   
               return do_shortcode(
                   sprintf(
                       '[products ids="%s"]',
                       implode(',', $ids)
                   )
               );
           }
   
           private function getProductsInStockSince(int $days): array
           {
               if ($days < 1) {
                   return [];
               }
   
               $args = [
                   'post_type' => ['product', 'product_variation'],
                   'post_status' => 'publish',
                   'posts_per_page' => -1,
                   'meta_query' => [
                       [
                           'key' => '_stock',
                           'value' => 0,
                           'compare' => '>',
                       ],
                       [
                           'key' => $this->metaKey,
                           'value' => date('Y-m-d H:i:s', strtotime('-' . $days . ' days')),
                           'compare' => '>=',
                       ],
                   ],
               ];
   
               $query = new WP_Query($args);
   
               return $query->posts;
           }
       }
   
       new PhpBotWcBackInStockSince();
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro] List recent back in stock products](https://wordpress.org/support/topic/list-recent-back-in-stock-products/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/list-recent-back-in-stock-products/#post-15490915)
 * And is there a hook provided by your plugin, which fires an action, when the 
   product changes to back in stock?
 * Then we should be able to add an action, which saves a timestamp to the product
   meta, and we would be able to select the products with a meta query on WordPress.
 * Is there such an action hook?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Back In Stock Notifier for WooCommerce | WooCommerce Waitlist Pro] List recent back in stock products](https://wordpress.org/support/topic/list-recent-back-in-stock-products/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/list-recent-back-in-stock-products/#post-15490855)
 * Okay I see thank you
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] Sendinblue boolean attribute field doesn’t send any value](https://wordpress.org/support/topic/sendinblue-boolean-attribute-field-doesnt-send-any-value/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/sendinblue-boolean-attribute-field-doesnt-send-any-value/#post-15421840)
 * * TEST_BOOL (boolean)
    * TEST_CAT (category)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] Sendinblue boolean attribute field doesn’t send any value](https://wordpress.org/support/topic/sendinblue-boolean-attribute-field-doesnt-send-any-value/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/sendinblue-boolean-attribute-field-doesnt-send-any-value/#post-15417996)
 *     ```
       [text* your-firstname "skllslslk"]
       [email* your-email "dsds@dsds.uk"]
       [checkbox* your-test_bool use_label_element "dsksdkldksl"]
       [select your-test_cat "some val" "another val"]
       [submit "Submit"]
       ```
   
    -  This reply was modified 4 years, 2 months ago by [phpbot](https://wordpress.org/support/users/phpbot/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7] Sendinblue boolean attribute field doesn’t send any value](https://wordpress.org/support/topic/sendinblue-boolean-attribute-field-doesnt-send-any-value/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/sendinblue-boolean-attribute-field-doesnt-send-any-value/#post-15417722)
 * For now, it’s just a local installation of [https://localwp.com](https://localwp.com)
 * However, just created a blank installation with CF7 and the only fields I was
   able to submit to SIB, were the email field and text fields. So, since it is 
   a totally blank installation, it should be possible to reproduce that quite fast.
 * Using `select` in CF7 and a `category` field type in SIB doesn’t submit any value.
 * The same goes for `checkbox` in CF7 and `boolean` in SIB.
 * These data types seem to be passed incorrectly, I guess?
 * Just to note, the API connection is set up successfully and submitting forms 
   creates new contacts with the mentioned field values (email, text).
 * Also, field names are correctly prefixed with `your-`.
 * Anything we can do to submit other data types through the corresponding form 
   fields?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Kadence WooCommerce Email Designer] Apply design to “Password Changed” email](https://wordpress.org/support/topic/apply-design-to-password-changed-email/)
 *  Thread Starter [phpbot](https://wordpress.org/support/users/phpbot/)
 * (@phpbot)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/apply-design-to-password-changed-email/#post-14929505)
 * Hey Karla,
 * Okay okay I see the point.
 * Thanks for answering and explaing and providing ressources.

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

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