Plugin Directory

Changeset 2556202


Ignore:
Timestamp:
06/30/2021 07:24:44 AM (5 years ago)
Author:
resoc
Message:

Version 1.0.9

Location:
resoc/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • resoc/trunk/README.txt

    r2550347 r2556202  
    55Requires at least: 5.0
    66Tested up to: 5.7.2
    7 Stable tag: 1.0.8
     7Stable tag: 1.0.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8181== Changelog ==
    8282
     83= 1.0.9 =
     84* Support right-to-left languages
     85
    8386= 1.0.8 =
    8487* Improvements for the plugins list page
  • resoc/trunk/admin/class-resoc-admin.php

    r2550347 r2556202  
    111111        'mainImageUrl' => $featured_image,
    112112        'logoUrl' => Resoc_Utils::get_logo_as_base64(),
    113         'brandName' => $plugin_options[ Resoc_Settings::BRAND_NAME ]
     113        'brandName' => $plugin_options[ Resoc_Settings::BRAND_NAME ],
     114        'textDirection' => isset( $plugin_options[ Resoc_Settings::TEXT_DIRECTION ] )
     115          ? $plugin_options[ Resoc_Settings::TEXT_DIRECTION ]
     116          : 'ltr'
    114117      )
    115118    );
  • resoc/trunk/admin/class-resoc-settings.php

    r2548884 r2556202  
    3030  const BRAND_NAME       = 'brand-name';
    3131  const LOGO             = 'logo';
     32  const TEXT_DIRECTION   = 'textDirection';
    3233
    3334  /**
     
    160161      array(
    161162        'label_for'         => Resoc_Settings::BRAND_NAME,
     163        'class'             => 'resoc-row'
     164      )
     165    );
     166
     167    add_settings_field(
     168      Resoc_Settings::TEXT_DIRECTION,
     169      'Text direction',
     170      array( $this, 'field_text_direction_callback' ),
     171      'resoc',
     172      'resoc_section',
     173      array(
     174        'label_for'         => Resoc_Settings::TEXT_DIRECTION,
    162175        'class'             => 'resoc-row'
    163176      )
     
    300313  }
    301314
     315  function field_text_direction_callback( $args ) {
     316    $options = get_option( 'resoc_options' );
     317    $text_direction = isset( $options[ $args['label_for'] ] )
     318      ? $options[ $args['label_for'] ]
     319      : 'ltr';
     320
     321    ?>
     322      <fieldset class="resoc-text-direction-list">
     323    <?php
     324
     325    foreach( [
     326      array( 'slug' => 'ltr', 'name' => 'Left-to-Right (English, Spanish...)' ),
     327      array( 'slug' => 'rtl', 'name' => 'Right-to-Left (Arabic, Hebrew...)' )
     328    ] as $direction ) {
     329      ?>
     330        <div class="resoc-text-direction">
     331          <input
     332            type="radio"
     333            id="<?php echo esc_attr( $args['label_for'] . '-' . $direction[ 'slug' ] ); ?>"
     334            name="resoc_options[<?php echo esc_attr( $args['label_for'] ); ?>]"
     335            value="<?php echo esc_attr( $direction[ 'slug' ] ) ?>"
     336            <?php echo checked( $text_direction, $direction[ 'slug' ], false ) ?>
     337          />
     338          <label for="<?php echo esc_attr( $args['label_for'] . '-' . $direction[ 'slug' ] ); ?>">
     339            <?php echo esc_html( ucfirst( $direction[ 'name' ] ) ) ?>
     340          </label>
     341        </div>
     342      <?php
     343    }
     344
     345    ?>
     346      </fieldset>
     347    <?php
     348  }
     349
    302350    /**
    303351     * Register the stylesheets for the admin area.
  • resoc/trunk/resoc.php

    r2550347 r2556202  
    1717 * Plugin URI:        https://resoc.io/resoc-uri/
    1818 * Description:       Improve the images used to illustrate your content when it is share on social networks and messaging services.
    19  * Version:           1.0.8
     19 * Version:           1.0.9
    2020 * Author:            Resoc
    2121 * Author URI:        https://resoc.io/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'RESOC_VERSION', '1.0.8' );
     38define( 'RESOC_VERSION', '1.0.9' );
    3939
    4040/**
Note: See TracChangeset for help on using the changeset viewer.