Change the Labels of Users to Customers in Admin
As suggested by Sally CJ in the comments. gettext was the easiest and fastest way to make this possible.
As suggested by Sally CJ in the comments. gettext was the easiest and fastest way to make this possible.
You have to use a plural aware function like _n() or _nx(), because the words around the number might change in some languages depending on the amount items. For visible numbers use number_format_i18n() and %s, not %d. You cannot reuse the labels, because plural forms change depending on context in some languages. This is how … Read more
If we want to have the reset password form to look like this: then we could use the following hooks: /** * Modify the password hint */ add_filter( ‘password_hint’, function( $hint ) { return __( ‘Use upper and lower case letters, numbers, and symbols like ! ” ? $ % ^ & ).’ ); } … Read more
You can modify the labels using gettext filter hook ex: add_filter( ‘gettext’, ‘theme_change_label_names’); function theme_change_label_names($translated_text){ if (is_admin()){ switch ( $translated_text ) { case ‘Site Title’ : $translated_text = __( ‘New Site Title label’, ‘theme_text_domain’ ); break; case ‘Tagline’ : $translated_text = __( ‘new Tagline label’, ‘theme_text_domain’ ); break; } } return $translated_text; }
Try this, which worked for me: <?php $fields = get_field_objects(); // I changed from get_fields() if( $fields ): ?> <ul> <?php // I changed $value to $field (i.e. the variable name) foreach( $fields as $name => $field ): if (stripos($name, ‘isbn’) !== false) : ?> <li><b><?php echo $field[‘label’]; ?></b> <?php echo $field[‘value’]; ?></li> <?php endif; … Read more
Based on information gathered HERE and HERE; I was able to put something together. First… abandon your first approach. It will add a field value, yes. But it will not allow you to add a descriptive field. Instead, we need to create an entire new table tag in the structure that gets populated from WordPress. … Read more
add_action( ‘admin_head’, ‘custom_post_type_icon’ ); function custom_post_type_icon() { ?> <style type=”text/css” media=”screen”> #menu-posts-intranet-pages .wp-menu-image { background: url(“PATH TO SMALL ICON”) no-repeat 6px 6px !important; } #menu-posts-intranet-pages:hover .wp-menu-image, #menu-posts-intranet-pages.wp-has-current-submenu .wp-menu-image { background-position:6px -16px !important; } #icon-edit.icon32-posts-intranet-pages {background: url(“PATH TO BIG ICON”) no-repeat;} </style> <?php } This way is much better I believe as it also allows to … Read more
SOLVED. You have to load the load_theme_textdomain not by action but directly written as first line on the file functions.php Now my custom post type labels are finally translated 🙂
You can try the gettext filter. According to the Codex: This filter hook is applied to the translated text by the internationalization functions (__(), _e(), _x(), etc.). This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. Here’s an example: function custom_gettext( $translated_text, $untranslated_text, … Read more
In WordPress 4.4 we will be able to use the long waited term meta so you might use that to store the extra info for your terms. The Term Meta API calls are: Add term meta: Function call: add_term_meta( $term_id, $meta_key, $meta_value, $unique ); Description: /** * Adds metadata to a term. * * @since … Read more