Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Display LSB on ACF Option pages
Browse files Browse the repository at this point in the history
  • Loading branch information
funkjedi committed Nov 18, 2016
1 parent f33c6ef commit eac6176
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion acf-qtranslate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Advanced Custom Fields: qTranslate
Plugin URI: http://github.com/funkjedi/acf-qtranslate
Description: Provides multilingual versions of the text, text area, and wysiwyg fields.
Version: 1.7.14
Version: 1.7.15
Author: funkjedi
Author URI: http://funkjedi.com
License: GPLv2 or later
Expand Down
6 changes: 0 additions & 6 deletions assets/acf_4/qtranslatex.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ jQuery(window).load(function() {
// Enable the language switching buttons
qTranslateConfig.qtx.enableLanguageSwitchingButtons('block');

// Add display hooks to ACF metaboxes
jQuery('.acf_postbox h3 span').each(function() {
this.id = _.uniqueId('acf-postbox-h3-span');
qTranslateConfig.qtx.addDisplayHookById(this.id);
});


// Ensure that translation of standard field types is enabled
if (!window.acf_qtranslate_translate_standard_field_types) {
Expand Down
6 changes: 0 additions & 6 deletions assets/acf_5/qtranslatex.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
// Enable the language switching buttons
qTranslateConfig.qtx.enableLanguageSwitchingButtons('block');

// Add display hooks to ACF metaboxes
jQuery('.acf-postbox h3 span').each(function() {
this.id = _.uniqueId('acf-postbox-h3-span');
qTranslateConfig.qtx.addDisplayHookById(this.id);
});


// Ensure that translation of standard field types is enabled
if (!window.acf_qtranslate_translate_standard_field_types) {
Expand Down
9 changes: 6 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: funkjedi
Tags: acf, advanced custom fields, qtranslate, add-on, admin
Requires at least: 3.5.0
Tested up to: 4.2.1
Version: 1.7.14
Stable tag: 1.7.14
Tested up to: 4.6.1
Version: 1.7.15
Stable tag: 1.7.15
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -59,6 +59,9 @@ The plugin is based on code samples posted to the ACF support forums by taeo bac

== Changelog ==

= 1.7.15 =
* Core: Display LSB on ACF Option pages

= 1.7.14 =
* Bug Fix: Bumped `after_setup_theme` priority to fix ACF4 field inclusion

Expand Down
29 changes: 29 additions & 0 deletions src/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function __construct() {
add_action('admin_menu', array($this, 'admin_menu'));
add_action('admin_init', array($this, 'admin_init'));

add_filter('qtranslate_load_admin_page_config', array($this, 'qtranslate_load_admin_page_config'));
add_filter('plugin_action_links_' . plugin_basename(ACF_QTRANSLATE_PLUGIN), array($this, 'plugin_action_links'));
}

Expand Down Expand Up @@ -174,6 +175,34 @@ public function plugin_action_links($links) {
return $links;
}

/**
* Enable the display of the LSB on ACF Options pages.
* @param array
* @return array
*/
public function qtranslate_load_admin_page_config($config)
{
$config['acf-options-page'] = array(
'pages' => array('admin.php' => 'page='),
'anchors' => array('poststuff' => array('where' => 'first last')),
'forms' => array(
'post' => array(
'fields' => array(
'acf4-field-group-hX' => array(
'jquery' => '.acf_postbox h2 span,.acf_postbox h3 span',
'encode' => 'display',
),
'acf5-field-group-hX' => array(
'jquery' => '.acf-postbox h2 span,.acf-postbox h3 span',
'encode' => 'display',
),
)),
),
);

return $config;
}

/**
* Retrieve the value of a plugin setting.
*/
Expand Down

0 comments on commit eac6176

Please sign in to comment.