Title: mkdgs's Replies | WordPress.org

---

# mkdgs

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Change locale inside ajax call](https://wordpress.org/support/topic/change-locale-inside-ajax-call/)
 *  [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/change-locale-inside-ajax-call/#post-8901734)
 * Have you tried to not call load_plugin_textdomain() at plugin init when it’s 
   an ajax request ?
 * ( And call it into mbd_invoice_create_pdf() )
    -  This reply was modified 9 years, 4 months ago by [mkdgs](https://wordpress.org/support/users/mkdgs/).
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Change locale inside ajax call](https://wordpress.org/support/topic/change-locale-inside-ajax-call/)
 *  [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/change-locale-inside-ajax-call/#post-8901673)
 * When i take look to the code of load_plugin_textdomain()
 * I see:
 *     ```
       $locale = apply_filters( 'plugin_locale', is_admin() ? get_user_locale() : get_locale(), $domain );
       $mofile = $domain . '-' . $locale . '.mo';
       ```
   
 * So use filter ‘plugin_locale’ before load_plugin_textdomain() and removing it
   after may do the trick.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [custom template not show on Preview](https://wordpress.org/support/topic/custom-template-not-show-on-preview/)
 *  Thread Starter [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/custom-template-not-show-on-preview/#post-8901649)
 * Thanks [@karpstrucking](https://wordpress.org/support/users/karpstrucking/),
 * It’s convenient for my own use but a little bit hard to explain to other.
    I 
   want to get it work, i can fix it, but i don’t want recoding the wheel 🙂
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Change locale inside ajax call](https://wordpress.org/support/topic/change-locale-inside-ajax-call/)
 *  [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/change-locale-inside-ajax-call/#post-8898698)
 * It’s probably more easy to set the filter like you do, and removing it after 
   when the pdf is created.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [advice FOR plugin tabs](https://wordpress.org/support/topic/advice-for-plugin-tabs/)
 *  [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/advice-for-plugin-tabs/#post-8898503)
 * With your theme i don’t know, but may be with some line of CSS.
    Like that [http://htmldog.com/techniques/tabs/](http://htmldog.com/techniques/tabs/)
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [connect users to Custom post types](https://wordpress.org/support/topic/connect-users-to-custom-post-types/)
 *  [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/connect-users-to-custom-post-types/#post-8898461)
 * This plugin can be a part of your solution:
    [https://wordpress.org/plugins/posts-to-posts/](https://wordpress.org/plugins/posts-to-posts/)
 * It’s not a plugins for end user, but more a library for building advanced things.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [advice FOR plugin tabs](https://wordpress.org/support/topic/advice-for-plugin-tabs/)
 *  [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/advice-for-plugin-tabs/#post-8898449)
 * If i need to create something like that i create a menu and stylized like a tab.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [For post preview, a way to filter metadata value (like save_post hook)](https://wordpress.org/support/topic/for-post-preview-a-way-to-filter-metadata-value-like-save_post-hook/)
 *  Thread Starter [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/for-post-preview-a-way-to-filter-metadata-value-like-save_post-hook/#post-8898067)
 * I think to try something ugly like:
 * in /my_themes/function.php
 *     ```
       if (isset($_POST['wp-preview']) && $_POST['wp-preview'] == 'dopreview') {
         //   filter and serialise my meta  
         foreach ( $_POST['meta'] as $k => $v ) {    
                if( $k === 'my_meta') {
                   $_POST['meta'][$k] = json_encode($v);
                }
         }
       }
       ```
   
 * And serialize in json only if it’s not already a string in my save_post filter.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [For post preview, a way to filter metadata value (like save_post hook)](https://wordpress.org/support/topic/for-post-preview-a-way-to-filter-metadata-value-like-save_post-hook/)
 *  Thread Starter [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/for-post-preview-a-way-to-filter-metadata-value-like-save_post-hook/#post-8897743)
 * Unfortunaly ‘wp_creating_autosave’ is triggered few line after normalize_whitespace().
 *     ```
       // Store one autosave per author. If there is already an autosave, overwrite it.
       	if ( $old_autosave = wp_get_post_autosave( $post_id, $post_author ) ) {
       		$new_autosave = _wp_post_revision_data( $post_data, true );
   
       		$new_autosave['ID'] = $old_autosave->ID;
       		$new_autosave['post_author'] = $post_author;
   
       		// If the new autosave has the same content as the post, delete the autosave.
       		$post = get_post( $post_id );
       		$autosave_is_different = false;
   
       		foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {
       			if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
   
       				$autosave_is_different = true;
       				break;
       			}
       		}
   
       		if ( ! $autosave_is_different ) {
       			wp_delete_post_revision( $old_autosave->ID );
       			return 0;
       		}
   
       		/**
       		 * Fires before an autosave is stored.
       		 *
       		 * @since 4.1.0
       		 *
       		 * @param array $new_autosave Post array - the autosave that is about to be saved.
       		 */
       		do_action( 'wp_creating_autosave', $new_autosave );
   
       		return wp_update_post( $new_autosave );
       	}
       ```
   
 *   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] wp-seo-post-scraper-360.min.js?ver=3.6:6](https://wordpress.org/support/topic/wp-seo-post-scraper-360-min-jsver3-66/)
 *  [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wp-seo-post-scraper-360-min-jsver3-66/#post-8254128)
 * Same issue with woocommerce, that was solved by disabling Wp Seo.
    -  This reply was modified 9 years, 9 months ago by [mkdgs](https://wordpress.org/support/users/mkdgs/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Taxonomy Templates] Fix translation and template name](https://wordpress.org/support/topic/fix-translation-and-template-name/)
 *  Thread Starter [mkdgs](https://wordpress.org/support/users/mkdgs/)
 * (@mkdgs)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/fix-translation-and-template-name/#post-7647592)
 * The problem appear if you use WordPress in a different language than the developper.
 * For exemple i am french and “category” is translated to “Catégorie”.
    So “Category
   template” not work. Using singular name it can be tricky.

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