Title: Jonas Lundman's Replies | WordPress.org

---

# Jonas Lundman

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

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

 Search replies:

## Forum Replies Created

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

1 [2](https://wordpress.org/support/users/intervik/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/intervik/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/intervik/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/intervik/replies/page/5/?output_format=md)
[6](https://wordpress.org/support/users/intervik/replies/page/6/?output_format=md)
[→](https://wordpress.org/support/users/intervik/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Admin Menu Post List] Maybe Solved Couldn’t match CSS with new menu item style](https://wordpress.org/support/topic/maybe-solved-couldnt-match-css-with-new-menu-item-style/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/maybe-solved-couldnt-match-css-with-new-menu-item-style/#post-14174884)
 * Yeh, the border is ok, but we decide to keep the dropdowns compact and only let
   the side bar apply to the original menu items.
 * [[
 * / J
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Hidden Database error](https://wordpress.org/support/topic/hidden-database-error/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/hidden-database-error/#post-14173150)
 * Closing topic, development team found a maybe conflict with YOAST WOOCOMMERCE
   plugin. Moving to Yoast support pages as this is a commercial plugin.
    -  This reply was modified 5 years, 2 months ago by [Jonas Lundman](https://wordpress.org/support/users/intervik/).
      Reason: Added reasons
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Forms for ACF] Suggest to a filter](https://wordpress.org/support/topic/suggest-to-a-filter/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/suggest-to-a-filter/#post-13660564)
 * So as we speak as conclusion, I suggest you try your idea of custom template 
   filter, and we can try to adapt our needs from there.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Forms for ACF] Suggest to a filter](https://wordpress.org/support/topic/suggest-to-a-filter/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/suggest-to-a-filter/#post-13659942)
 * The “exposed API wouldn’t be very nice” – true – but the reason is an architecture
   question, and the method in use, is no good, with placeholders and function calls
   inside the sprintf. You also getting a lot of tabbed spaces inside the email 
   headers, as the “template” becomes one string from the protocol core-emails.php
   itself.
 * Well/ And, any filter and developers in WordPress can doing it wrong, so it is
   up to developers to make shure they doing the %s ordering correct.
 * >  Try your idea of a “filter out the whole template”, and see what comes out
   > of that.
 * **Case study:**
 * In our case, we cant enter the final html without suggested filter. We need to
   get rid of everything, and replace it with the `$email['content']` only, but 
   only if our added conditional `if(!$email['plain']) return $html;` is met.
 * As we added an extra checkbox to `array ('key' => 'field_form_email_plain', .......
   INSIDE FILTER af/form/notification_settings_fields`
 * As the validation on submitted form is done “twice” – first by ACF default ajax
   API and second by AF actions (and filters), Sending plain text requires more 
   cleanup then expected. When $_POST[‘acf’] is returning to the AF API, there is
   already a lot of wpautop() and dirt added to the textarea field. There is actually
   dubbled <p><p> sometimes in the chain but clears out in the end.
 * From our developers/ notes / example:
 *     ```
       /* Sanitize outgoing email for textareas */
       /* Used by '_af_render_field_include()' by api-helpers.php */
       /* Replaces the global $output = htmlspecialchars( $rendered_value ); */
       /* Otherwise any html tags will be visible in the messages */
       /* Remark: uses 'strip_tags_content()' PHP extension: */
       /* http://php.net/manual/en/function.strip-tags.php */
   
       function advanced_form_validate_textarea($output, $field, $value){
       	if(!$value) return $value;
       	if($field['type'] == 'textarea') return trim(wp_kses_post(wpautop(strip_tags(strip_tags_content($value, '<p>')))));
       		else return $output;
       }
       add_filter('af/field/render_include', 'advanced_form_validate_textarea', 10, 3 );
       ```
   
 * Other:
 *     ```
       /* remove hardcoded 'the_content' filter */
       /* some themes adding front end stuff and we don want them in our emails */
       function advanced_form_email_clean_content($content, $email, $form, $fields){
       	return $email['content'];
       }
       add_filter('af/form/email/content', 'advanced_form_email_clean_content', 10, 4);
       ```
   
 * And more…
 * So adding a filter to remove the default template string, please provide a lot
   of arguments from the original func, so we can do stuff…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Forms for ACF] Suggest to a filter](https://wordpress.org/support/topic/suggest-to-a-filter/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/suggest-to-a-filter/#post-13596299)
 * Hi
 * I dont think so, as we need the placeholders from the templates, and we also 
   send html to customers, but only plain to admins. The conditionals are therefor
   done by the filters for each mail as in `core-emails.php`, but the header output
   has no filter. Adding this works for us:
 *     ```
       		// Filter each html - needed
       		$html = apply_filters( 'af/form/email/html', $html, $email, $form, $fields, $subject, $style, $content);
       		$html = apply_filters( 'af/form/email/html/id=' . $form['post_id'], $html, $email, $form, $fields, $subject, $style, $content );
       		$html = apply_filters( 'af/form/email/html/key=' . $form['key'], $html, $email, $form, $fields, $subject, $style, $content );
       ```
   
 * As a start… But a checkbox “send as plain” for the notification email setup would
   be great in core version, but There are more functions in your plugin that needs
   to be fixed/ filtered, so that may be big step for you to do.
 * / INtervik
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Still problems with breadcrumbs and indexable 14.x](https://wordpress.org/support/topic/still-problems-with-breadcrumbs-and-indexable-14-x/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/still-problems-with-breadcrumbs-and-indexable-14-x/#post-13384701)
 * Ok
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Still problems with breadcrumbs and indexable 14.x](https://wordpress.org/support/topic/still-problems-with-breadcrumbs-and-indexable-14-x/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/still-problems-with-breadcrumbs-and-indexable-14-x/#post-13379218)
 * Please read. As I already wrote in my first description above:
 * The only way is to download and install Yoast Test Helper and press “Reset indexable…“.
   And then re-index again.
 * You answered:
 * Does the issue resolve if you do the following?
    1. Install & activate the Yoast
   Test Helper plugin …
 * Read: “Please understand the problem:” in my second answer.
 * Do not close before reading the replies.
 * Report this to a developer, or test the bug. We cant have bug live and “link 
   to my website” for this matter.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Messing with Metaboxes custom order](https://wordpress.org/support/topic/messing-with-metaboxes-custom-order/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/messing-with-metaboxes-custom-order/#post-13366432)
 * Thanks for a quick reply!
 * We are not using Gutenberg. All sites running Classic Editor. No problema ever
   before until some weeks ago. Running 12 sites, same started on all some updates
   ago. (different reported dates by different clients)
 * However, It seems like it is the Extension Yoast Woocommerce, with added checkbox“
   above Yoast default metabox” that messing up custom metabox orders. Remember 
   that many not using Gutenberg when dev plugins! My personal settings are:
 *     ```
       Top (High prio)
       1: Product Short description
       2: Product settings and attributes
       3: Product Long description (editor)
       Mid (old default below)
       1: Custom fields
       2: Custom fields
       3: Custom fields ...
       Below (the new added section)
       1: Yoast SEO
       2: Custom fields ...
       Sidebar:
       - whatever
       ```
   
 * When Yaost Woocommmerce active, `The 2: Product settings and attributes` moves
   below Yaost bottom metabox every pageload… It is a javascript listener as we 
   can see the “jump”.
 * > Well, Read this – **and mark** as resolved – as **this is a PRO** paid BUG 
   > support **issue**
 * We discovered this same day we wrote the ticket here…
    -  This reply was modified 5 years, 8 months ago by [Jonas Lundman](https://wordpress.org/support/users/intervik/).
      Reason: spelling
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Advanced Forms for ACF] Reply-to](https://wordpress.org/support/topic/reply-to-10/)
 *  [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/reply-to-10/#post-13362887)
 * I’m just amazed that this is not a part of the form admin, as Big guns like Hostinger
   and many many webhosting not allow to smtp `from:` another mailaccount / mailaddress
   that not resident on the same domain. You cant have the visitors `from:` populated
   in the headers, but as a go-around, the reply-to headers works, and answer your
   client is possible without “anwer yourself” in your email client.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Fastest Cache - WordPress Cache Plugin] How to clear a is_post_type_archive index pages (only)?](https://wordpress.org/support/topic/how-to-clear-a-is_post_type_archive-index-pages-only/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/how-to-clear-a-is_post_type_archive-index-pages-only/#post-13351842)
 * Hi, The parent for a product is: a taxonomy term, like “/Seating/” for the product“
   Roly Poly Arm Chair”. Yes, all taxomoies – or if you prefer the word parent –
   are cleared for current post id (or product id) update. Same as tags or whatever**
   taxonomy term** in use. **BUT NOT** the post type archive.
 * is_tax() – is_tag() – is_cat() = taxonomies
    is_singular() = pageload by id (
   post, page, product) Shortcuts built in archives are is_date(), is_author(), 
   is_home() = Not by id, by slug and then finally you also have: is_post_type_archive()
   = post type archive [https://developer.wordpress.org/reference/functions/is_post_type_archive/](https://developer.wordpress.org/reference/functions/is_post_type_archive/)
 * is_home() is “built in” conditional for post type archive for “post”, just like
   is_category() is for the built in taxonomy ‘category’, still it should meet is_tax()
   as true, and blog index page should meet is_post_type_archive(‘post’) as true.
   Instead, WP pick them out with unique conditionals.
 * But all other custom post types is using is_post_type_archive(), if archive is
   activated when register_post_type is called.
 * So, A lot of custom post types have their own archive = is_post_type_archive()
   like events, products, locations and more. They usally comes with a placeholder
   redirect, like a page, that carries the title. Just like “blog” setting page.
 * In Woocommerce the default is ‘shop’.
 * Fastest cache is caching the correct archive index and creates the index.html
 * It seem that WFC using paths from the url and creates the folder from that. Install
   Woocommerce and you will see that te folder ‘shop’ will never have a product 
   category inside. Taxonomies seems to be recursive by the top parent term url.
 * The correct way to get the path should be `get_post_type_archive_link('product')`
   or `get_post_type_archive_link('post')` = (same as is_home()).
 * You should use: `get_post_type_archive_link(get_post_type($post_id));`
 *     ```
       public function singleDeleteCache(
           ...
           $archive_path = get_post_type_archive_link(get_post_type($post_id));
          if(preg_match("/https?:\/\/[^\/]+   .... $archive_path ...
          clear this index.html as well....
       }
       ```
   
    -  This reply was modified 5 years, 8 months ago by [Jonas Lundman](https://wordpress.org/support/users/intervik/).
    -  This reply was modified 5 years, 8 months ago by [Jonas Lundman](https://wordpress.org/support/users/intervik/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Fastest Cache - WordPress Cache Plugin] How to clear a is_post_type_archive index pages (only)?](https://wordpress.org/support/topic/how-to-clear-a-is_post_type_archive-index-pages-only/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/how-to-clear-a-is_post_type_archive-index-pages-only/#post-13350918)
 * Yes, everytime a product is updated, we need to remove the cache for the post
   type archive page (woocommerce shop ‘page’) as well. For that, we need to trigger
   an action when a product is updated/ created, that @unlink the /wp-content/cache/
   all/shop/ index.html
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Still problems with breadcrumbs and indexable 14.x](https://wordpress.org/support/topic/still-problems-with-breadcrumbs-and-indexable-14-x/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/still-problems-with-breadcrumbs-and-indexable-14-x/#post-13349658)
 * Hi, this is not plugin related. We had te same issue with no plugins installed,
   on pages filtered by wordpress standard hooks. (Another tread some month ago)
 * We of cource testing on latest enviroments, different scenarios before asking
   support here. There are many cases, not only “one www to point and show issues
   to”. And broken breadcrumbs is not something we keep live… We always fix with
   the reset Yoast plugin tool…
 * **Please understand the problem:**
 * If you have a category set up like “Travel” -> “Greece” -> “Athens” and a permalink
   structure the same in breadcrumbs, with “blog” as base (or without), then go 
   to “Categories” Rename the slug “Greece” to “mediterranean”, the Yoast breadcrumb
   will still serve the old slug.
 * Or if you delete a category so the old becomes “Travel” -> “Athens”, the breadcrumb
   does not pickup this.
 * etc etc
 * There are more scenarios, like moving a dev to live server. There is always critical
   changes even live, on ex permalink setup, when client starts to add products,
   categories or whatever.
 * A button on Tools “Clear index and do it again” would solve a lot, as we DO EXPECT
   that moving around slugs needs to manually “flush”, just like WP core, recount
   terms, WPML, and many other plugins.
 * /Great cleanup by the way with 14.x, and the new approach is really nice
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Fastest Cache - WordPress Cache Plugin] How to clear a is_post_type_archive index pages (only)?](https://wordpress.org/support/topic/how-to-clear-a-is_post_type_archive-index-pages-only/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/how-to-clear-a-is_post_type_archive-index-pages-only/#post-13349569)
 * Hi, thanks for a quick answer.
 * So, the answer is You cant. The link you provide only clearing by id. Post type
   archives has no id.
 * It seems like deleteing manually the index.html file renew the cache. This can
   be done by @unlink but there is no do_action-hook in your code for by id, just
   an action if ALL cache is cleared.
 * I can see in your code that there are different conditions LIKE EXAMPLE “public
   function delete_author_page_cache”. If you provide a hook on each condition, 
   like `do_action('wpfc_delete_cache_of_term', $term_taxonomy_id)` and provide 
   any data as second argument, The Plugin “WP FASTEST CACHE” will be o good choice
   for developers to implement as standard for their clients projects.
 * Note, the argument must also provide the `getWpContentDir("/cache/all/")` and
   or `$path` (or $out[0]) like:
 * `do_action('wpfc_delete_cache_of_term', $term_taxonomy_id, $this->getWpContentDir("/
   cache/all/"), $path)`
 * or a complete example:
 *     ```
       public function delete_author_page_cache($post_id){
       	$author_id = get_post_field ('post_author', $post_id);
       	$permalink = get_author_posts_url($author_id);
   
       	if(preg_match("/https?:\/\/[^\/]+\/(.+)/", $permalink, $out)){
       		$path = $this->getWpContentDir("/cache/all/").$out[1];
       		$mobile_path = $this->getWpContentDir("/cache/wpfc-mobile-cache/").$out[1];
   
       		$this->rm_folder_recursively($path);
       		$this->rm_folder_recursively($mobile_path);
       		/* hook */
       		do_action('wpfc_delete_author_page_cache', $post_id, $author_id, $path, $mobile_path);
       	}
       }
       ```
   
    -  This reply was modified 5 years, 8 months ago by [Jonas Lundman](https://wordpress.org/support/users/intervik/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Yoast SEO - Advanced SEO with real-time guidance and built-in AI] add_filter(page_link) no longer working as expected on breadcrumbs](https://wordpress.org/support/topic/add_filterpage_link-no-longer-working-as-expected-on-breadcrumbs/)
 *  Thread Starter [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/add_filterpage_link-no-longer-working-as-expected-on-breadcrumbs/#post-13311679)
 * We solved the problem by remove all Yoast options and re-index again did the 
   trick on old installs. We cant reproduce the problem anymore on new installs.
   Marking this as solved for now.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Mail Logging] contextual_help is deprecated since version 3.3.0](https://wordpress.org/support/topic/contextual_help-is-deprecated-since-version-3-3-0/)
 *  [Jonas Lundman](https://wordpress.org/support/users/intervik/)
 * (@intervik)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/contextual_help-is-deprecated-since-version-3-3-0/page/2/#post-13172423)
 * Change:
 * `add_action('contextual_help' ...`
 * **To:**
 * `add_action('current_screen', ...`
 * Remove all arguments, as for 3.3 it is not “filtered in” by adding anymore. It
   works as same as like adminbar->add by calling the current screen object:
 *     ```
       $screen = get_current_screen();
       $help_content = '<p>Hallo world</p>';
       $screen->add_help_tab(array(
       	'id'  => 'my-contextual-screen-id',
       	'title' => 'Screen information',
       	'content' => $help_content,
       ));
       ```
   

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

1 [2](https://wordpress.org/support/users/intervik/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/intervik/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/intervik/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/intervik/replies/page/5/?output_format=md)
[6](https://wordpress.org/support/users/intervik/replies/page/6/?output_format=md)
[→](https://wordpress.org/support/users/intervik/replies/page/2/?output_format=md)