• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
    • Help
      • Online help
      • Learn Git
      • Welcome to Bitbucket
      • Keyboard shortcuts
    • Log In
    Blackrock
    1. Blackrock

    main

    Public
    Actions
    • Clone

    Learn more about cloning repositories

    You have read-only access

    Navigation
    • Source
    • Commits
    • Branches
    • All Branches Graph
    • Graphs
    • Forks
    1. Blackrock
    2. main

    Source

    main/wp-content/plugins/sitepress-multilingual-cms/templates/language-switcher-admin-ui/dropdown-templates.twig
    Артем ШиряевАртем Ширяев committed 554847ddcb906 Apr 2021
    Raw file
    Source viewDiff to previous
    ​x
     
    1
    {% set supported_core_templates = [] %}
    2
    {% set supported_custom_templates = [] %}
    3
    ​
    4
    {% for template in data.templates if slot_type in template.supported_slot_types %}
    5
        {% if template.is_core %}
    6
            {% set supported_core_templates = supported_core_templates|merge([template]) %}
    7
        {% else %}
    8
            {% set supported_custom_templates = supported_custom_templates|merge([template]) %}
    9
        {% endif %}
    10
    {% endfor %}
    11
    ​
    12
    {% set total_templates = (supported_core_templates|length) + (supported_custom_templates|length)%}
    13
    ​
    14
    <div{% if total_templates <= 1 %} class="hidden"{% endif %}>
    15
    ​
    16
        <h4><label for="template-{{ id }}">{{ strings.misc.templates_dropdown_label }}</label>  {% include 'tooltip.twig' with { "content": strings.tooltips.available_templates } %}</h4>
    17
    ​
    18
        <select id="template-{{ id }}" name="{{ name }}" class="js-wpml-ls-template-selector js-wpml-ls-trigger-update">
    19
    ​
    20
            <optgroup label="{{ strings.misc.templates_wpml_group }}">
    21
            {% for template in supported_core_templates %}
    22
                {% set template_data = template.get_template_data() %}
    23
                <option value="{{ template_data.slug }}" {% if value == template_data.slug %}selected="selected"{% endif %}>{{ template_data.name }}</option>
    24
            {% endfor %}
    25
            </optgroup>
    26
    ​
    27
            {% if supported_custom_templates|length > 0 %}
    28
                <optgroup label="{{ strings.misc.templates_custom_group }}">
    29
                {% for template in supported_custom_templates %}
    30
                    {% set template_data = template.get_template_data() %}
    31
                    <option value="{{ template_data.slug }}" {% if value == template_data.slug %}selected="selected"{% endif %}>{{ template_data.name }}</option>
    32
                {% endfor %}
    33
                </optgroup>
    34
            {% endif %}
    35
    ​
    36
        </select>
    37
    ​
    38
    </div>
    • Git repository management for enterprise teams powered by Atlassian Bitbucket
    • Atlassian Bitbucket v5.10.1
    • Documentation
    • Contact Support
    • Request a feature
    • About
    • Contact Atlassian
    Atlassian

    Everything looks good. Well let you know here if theres anything you should know about.