Title: Peter's Replies | WordPress.org

---

# Peter

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

 *   [Profile](https://wordpress.org/support/users/digitalform/)
 *   [Topics Started](https://wordpress.org/support/users/digitalform/topics/)
 *   [Replies Created](https://wordpress.org/support/users/digitalform/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/digitalform/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/digitalform/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/digitalform/engagements/)
 *   [Favorites](https://wordpress.org/support/users/digitalform/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: [[Rename Media Files: Improve Your WordPress SEO] Get back the post ID](https://wordpress.org/support/topic/get-back-the-post-id/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/get-back-the-post-id/#post-16182937)
 * Update:
    Unfortunately, I don’t get all ACF fields back. And I want to translate
   some fields by “if”.
 * I use this code:
 *     ```
       add_filter('frou_sanitize_file_name', function($filename_infs) { 
   
       	global $post;
   
       	$p_id = $post['ID'];
   
       	// Buy or rent
       	$buy_rent = '';
       	if (get_field('buy_rent', $p_id) == 'buy') { 
       		$buy_rent = 'elado';
       	} else {
       		$buy_rent = 'kiado';
       	}
   
       	$filename_infs['structure']['translation']['my_custom_rule'] = $buy_rent.'-property-'.$p_id;
   
       	return $filename_infs;
       }, 20);
       ```
   
 * UPDATE 2:
    I got the ID with this: `$p_id = \FROU\WordPress\Post::get_parent_post_id();`
    -  This reply was modified 3 years, 7 months ago by [Peter](https://wordpress.org/support/users/digitalform/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Media File Renamer: Rename for better SEO (AI-Powered)] Rename file by ACF field, title and ID](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/#post-16177290)
 * Meanwhile, I realized that $post is not the post (property post_type), but the
   media file. 🙁
    That’s why it didn’t work.
 * Best regards,
    Peter
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Media File Renamer: Rename for better SEO (AI-Powered)] Rename file by ACF field, title and ID](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/#post-16176618)
 * Hello Jordy,
 * In the functions.php.
 * Your tutorial code works:
 *     ```
       // Override the filename naming rules with this filter
       add_filter( 'mfrh_new_filename', 'my_filter_filename', 10, 3 );
   
       function my_filter_filename( $new, $old, $post ) {
   
         // Get the date from the $post (which is the media entry) and convert it to a timestamp
         $post_date = strtotime( $post['post_date'] );
   
         // Make this timestamp to looks like 2018-01-01
         $formatted_date = date('Y-m-d', $post_date);
   
         // Add this timestamp in front of the filename already decided by Media File Renamer
         $new_filename = $formatted_date . "-" . $new;
   
         return $new_filename;
       }
       ```
   
 * But not mine. 🙁
 * – Peter
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Media File Renamer: Rename for better SEO (AI-Powered)] Rename file by ACF field, title and ID](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/#post-16176431)
 * Hello Jordy,
 * Thanks for the answer.
    But the code below doesn’t work.
 *     ```
       function custom_filter_filename($new, $old, $post) { 
   
       	$p_id = $post['ID'];
       	$p_title = $post['post_name'];
       	$buy_rent = get_field('buy_rent', $p_id);
   
       	return $buy_rent.'-'.$p_title.'-'.$p_id.'.jpg';
       }
       add_filter('mfrh_new_filename', 'custom_filter_filename', 10, 3);
       ```
   
 * I uploaded a picture. The name is Marbella-Property.jpg.
    The plugin renamed 
   it to: marbella-property.jpg
 * But that’s not good. This would be the correct new file name: sale-marbella-property-
   1458.jpg
 * The 1458 is the post ID.
 * Is my PHP code wrong?
 * Kind regards,
    Peter
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Media File Renamer: Rename for better SEO (AI-Powered)] Rename file by ACF field, title and ID](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/rename-file-by-acf-field-title-and-id/#post-16175976)
 * Dear Jordy,
 * What is the $new, $old and $post?
 * I saw a snipet: `$post_date = strtotime( $post['post_date'] );`
    I think I can
   recover the post ID by $post: `$p_id = $post['ID'];` And an ACF field: `$buy_rent
   = get_field('buy_rent', $p_id);`
 * And from these I want to give a unique file name to the images.
 * `$buy_rent.'-'.$p_title.'-'.$p_id.'.jpg';`
 * E.g. sale_property_title_5455.jpg
 * Is it possible with the “mfrh_new_filename” hook?
 * Best regards,
    Peter
    -  This reply was modified 3 years, 7 months ago by [Peter](https://wordpress.org/support/users/digitalform/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] Can’t delete untranslated content](https://wordpress.org/support/topic/cant-delete-untranslated-content/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/cant-delete-untranslated-content/#post-13114794)
 * Why don’t you answer the question??? Why don’t you indicate that the plugin is
   no longer supported???
    I made a new website without knowing that support for
   this plugin was finished. Now I have to remake this website with another plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] Custom taxonomy #2](https://wordpress.org/support/topic/custom-taxonomy-2-2/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-taxonomy-2-2/#post-10276842)
 * Another solution?
 * – Peter
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] Custom taxonomy #2](https://wordpress.org/support/topic/custom-taxonomy-2-2/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-taxonomy-2-2/#post-10266278)
 * Hi VaLeXaR,
 * I cleared all cache. The problem has NOT resolved.
 * – Peter
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] Custom Taxonomy](https://wordpress.org/support/topic/custom-taxonomy-50/)
 *  [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/custom-taxonomy-50/#post-10258370)
 * Hi VaLeXaR,
 * I set the new taxonomy and post type in the wpm-config.json file, but the doesn’t
   show the language switcher in the new post type and taxonomy page.
    The wpm-config.
   json file is in my template root.
 * {
    “post_types”: { “mobel”: {}, }, “taxonomies”: { “mobel_cat” : {}, }, }
 * Best regards,
    Peter
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] ACF Options page config](https://wordpress.org/support/topic/acf-options-page-config/)
 *  [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/acf-options-page-config/#post-10100699)
 * Hi VaLeXaR,
 * The ACF Options page id is 12810 (or toplevel_page_theme-special-settings). But
   the language switcher isn’t in the ACF Options page?
 * My code:
 * {
    “admin_pages”: [ 12810, “toplevel_page_theme-special-settings” ], },
    -  This reply was modified 8 years, 2 months ago by [Peter](https://wordpress.org/support/users/digitalform/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] ACF Options page config](https://wordpress.org/support/topic/acf-options-page-config/)
 *  [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/acf-options-page-config/#post-10080112)
 * Hi!
 * I put this code into the .json file:
    { “admin_pages”: [ “toplevel_page_theme-
   special-settings”, ], }
 * And there is not language switcher. 🙁
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] Contact Form 7](https://wordpress.org/support/topic/contact-form-7-310/)
 *  [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/contact-form-7-310/#post-10080051)
 * Hi VaLeXaR,
 * i put this code into the wpm-config.json, but the error message is duplicated.
 * {
    “post_types”: { “wpcf7_contact_form”: null }, “post_fields”: { “_form”: null,“
   _mail”: null, “_mail_2”: null, “_messages”: null } }
 * The error message: [:HU]DAS FELD IST ERFORDERLICH.[:DE]DAS FELD IST ERFORDERLICH.[:]
 * – Peter
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Multilang - Translation and Multilingual Plugin] Doesn’t work for me](https://wordpress.org/support/topic/doesnt-work-for-me-141/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/digitalform/)
 * (@digitalform)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/doesnt-work-for-me-141/#post-9894290)
 * Thank you VaLeXaR!

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