Return translated module tag.
public static translate_module_tag ( string $tag ) : mixed | ||
$tag | string | Tag as it appears in each module heading. |
return | mixed |
<?php $modules = array('Appearance', 'Developers', 'Mobile', 'Other', 'Photos and Videos', 'Social', 'WordPress.com Stats', 'Writing'); ?> <script id="tmpl-category" type="text/html"> <?php foreach ($modules as $module) { $translated_module = Jetpack::translate_module_tag($module); $module_slug = strtolower(str_replace(array(' ', '.'), array('-', ''), $translated_module)); ?> <div class="cat category-<?php echo esc_attr($module_slug); ?> "><h3><?php echo esc_html($translated_module); ?> </h3><div class="clear"></div></div> <?php } ?> </script> <script id="tmpl-modalLoading" type="text/html"> <div class="loading"><span><?php esc_html_e('loading…', 'jetpack'); ?> </span></div> </script> <script id="tmpl-mod" type="text/html"> <div href="{{ data.url }}" tabindex="0" data-index="{{ data.index }}" data-name="{{ data.name }}" class="module{{ ( data.new ) ? ' new' : '' }}{{ data.activated ? ' active' : '' }}"> <h3 class="icon {{ data.module }}">{{{ data.name }}}<# if ( ! data.free ) { #><span class="paid"><?php echo esc_html_x('Paid', 'As in Premium. Premium module description', 'jetpack');
function main_page_js_templates() { $modules = array('Appearance', 'Developers', 'Mobile', 'Other', 'Photos and Videos', 'Social', 'WordPress.com Stats', 'Writing'); ?> <script id="category" type="text/html"> <?php foreach ($modules as $module) { $translated_module = Jetpack::translate_module_tag($module); $module_slug = strtolower(str_replace(array(' ', '.'), array('-', ''), $translated_module)); ?> <div class="cat category-<?php echo esc_attr($module_slug); ?> "><h3><?php echo esc_html($translated_module); ?> </h3><div class="clear"></div></div> <?php } ?> </script> <script id="modalLoading" type="text/html"> <div class="loading"><span><?php esc_html_e('loading…', 'jetpack'); ?> </span></div> </script> <script id="modalTemplate" type="text/html"> <header> <a href="#" class="close">×</a> <ul> <li><a href="#" class="active"><?php esc_html_e('Learn More', 'jetpack'); ?> </a></li> </ul> </header> <div class="content-container"><div class="content"></div></div> </script> <script id="mod" type="text/html"> <div href="{{ url }}" data-index="{{ index }}" data-name="{{ name }}" class="module{{#new}} new{{/new}}"> <h3 class="icon {{ module }}">{{ name }}{{^free}}<span class="paid"><?php esc_html_e('Paid', 'jetpack'); ?> </span>{{/free}}</h3> <p>{{{ short_description }}}</p> </div> </script> <script id="modconfig" type="text/html"> <tr class="configs {{#active}}active{{/active}}"> <td class="sm"><input type="checkbox"></td> <td><a href="{{ url }}" data-name="{{ name }}">{{ name }}</a></td> <td class="med"><a href="{{ url }}" data-name="{{ name }}"><span class="genericon genericon-help" title="<?php esc_attr_e('Learn more', 'jetpack'); ?> "></span></a>{{#hasConfig}}<a href="{{ url }}" data-name="{{ name }}"><span class="genericon genericon-cog" title="<?php esc_attr_e('Configure', 'jetpack'); ?> "></span></a>{{/hasConfig}}</td> </tr> </script> <?php }